dotfiles

My PC Dotfiles & Website
commit 9d900dc7e4967793596b671f86efd66d893891ae
parent e76bf0b003b9e41cfa35034148748fe3fd615f5c
Author: maydayv7 <maydayv7@gmail.com>
Date:   Thu,  1 Feb 2024 21:44:08 +0530

feat: Hyprland Panel using Waybar

Also add `gui.fancy` and refactor Hyprland Configuration

Diffstat:

MREADME.md | 4++++
Mdevices/vortex.nix | 1+
Mfiles/colors/catppuccin.yaml | 4++--
Mfiles/flake.nix | 3+++
Afiles/images/desktop/hyprland.png | 0
Mfiles/ulauncher/settings/extension.json | 199+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mfiles/ulauncher/settings/scripts.json | 5+++++
Mflake.lock | 6+++---
Mmodules/README.md | 2++
Mmodules/apps/firefox.nix | 1+
Mmodules/apps/games.nix | 4+++-
Mmodules/gui/default.nix | 13++++++++-----
Mmodules/gui/desktop/gnome.nix | 4++--
Dmodules/gui/desktop/hyprland/apps.nix | 268-------------------------------------------------------------------------------
Amodules/gui/desktop/hyprland/apps/bar.nix | 252+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/desktop/hyprland/apps/default.nix | 213+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/desktop/hyprland/apps/security.nix | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmodules/gui/desktop/hyprland/binds.nix | 110-------------------------------------------------------------------------------
Mmodules/gui/desktop/hyprland/default.nix | 145+++++++++++--------------------------------------------------------------------
Dmodules/gui/desktop/hyprland/rules.nix | 24------------------------
Amodules/gui/desktop/hyprland/settings/default.nix | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/desktop/hyprland/settings/keybindings.nix | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/desktop/hyprland/settings/rules.nix | 22++++++++++++++++++++++
Mmodules/gui/desktop/pantheon.nix | 1+
Mmodules/gui/desktop/xfce/compositor.nix | 2+-
Mmodules/gui/desktop/xfce/default.nix | 9+++------
Mmodules/gui/fonts.nix | 2--
Mmodules/gui/launcher.nix | 4++--
Mmodules/gui/theme.nix | 8+++++++-
Mmodules/gui/wayland.nix | 4+++-
Mmodules/shell/zsh.nix | 6+++++-
Mmodules/user/default.nix | 2+-
Mpackages/firefox-elementary-theme/default.nix | 2+-
Mshells/python.nix | 8++++++--
34 files changed, 959 insertions(+), 659 deletions(-)

diff --git a/README.md b/README.md @@ -11,6 +11,10 @@ This [repository](https://github.com/maydayv7/dotfiles) contains the configurati <details> <summary>Desktop Pictures</summary> +| ![Hyprland](./files/images/desktop/hyprland.png) | +| :----------------------------------------------: | +| _Hyprland_ | + | ![GNOME Desktop](./files/images/desktop/gnome/desktop.png) | | :--------------------------------------------------------: | | _GNOME Desktop_ | diff --git a/devices/vortex.nix b/devices/vortex.nix @@ -42,6 +42,7 @@ gui = { desktop = "hyprland"; wallpaper = "Tetris"; + fancy = true; }; # User V7 diff --git a/files/colors/catppuccin.yaml b/files/colors/catppuccin.yaml @@ -7,12 +7,12 @@ base03: "494D64" base04: "5B6078" base05: "CAD3F5" base06: "F4DBD6" -base07: "B7BDf8" +base07: "B7BDF8" base08: "ED8796" base09: "F5A97F" base0A: "EED49F" base0B: "A6DA95" base0C: "8BD5CA" base0D: "8AADF4" -base0E: "C5A0F6" +base0E: "C6A0F6" base0F: "F0C6C6" diff --git a/files/flake.nix b/files/flake.nix @@ -18,6 +18,9 @@ cache = "maydayv7-dotfiles"; flake = "github:maydayv7/dotfiles"; repo = "https://github.com/maydayv7/dotfiles"; + + # Set PATH for SystemD Services + systemd = ''export PATH="''${XDG_BIN_HOME}:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"''; }; # ASCII Art diff --git a/files/images/desktop/hyprland.png b/files/images/desktop/hyprland.png Binary files differ. diff --git a/files/ulauncher/settings/extension.json b/files/ulauncher/settings/extension.json @@ -1,100 +1,100 @@ { - "com.github.ulauncher.ulauncher-emoji": { - "id": "com.github.ulauncher.ulauncher-emoji", - "url": "https://github.com/Ulauncher/ulauncher-emoji", - "updated_at": "2024-01-14T19:38:55.565827", - "last_commit": "827cfe5e1d2f89f742f811f981759787b0654fa9", - "last_commit_time": "2023-11-04T18:37:13" - }, - "com.github.iboyperson.ulauncher-system": { - "id": "com.github.iboyperson.ulauncher-system", - "url": "https://github.com/iboyperson/ulauncher-system", - "updated_at": "2024-01-14T19:40:03.269429", - "last_commit": "7dedd992709fa2297735cddf852404144d4da47c", - "last_commit_time": "2023-11-14T16:53:20" - }, - "com.github.ulauncher.ulauncher-timer": { - "id": "com.github.ulauncher.ulauncher-timer", - "url": "https://github.com/ulauncher/ulauncher-timer", - "updated_at": "2024-01-14T19:40:27.342707", - "last_commit": "2d3fe82fe1e38670e6eb8887cd2a4b4d1c2baa79", - "last_commit_time": "2023-03-25T08:07:41" - }, - "com.github.nastuzzisamy.ulauncher-custom-scripts": { - "id": "com.github.nastuzzisamy.ulauncher-custom-scripts", - "url": "https://github.com/NastuzziSamy/ulauncher-custom-scripts", - "updated_at": "2024-01-14T19:40:48.262263", - "last_commit": "7a68cbafb4acc01fed340d0d2ae99a6701724b31", - "last_commit_time": "2022-11-21T21:19:31" - }, - "com.github.ikorjefocur.ulauncher-commandrunner": { - "id": "com.github.ikorjefocur.ulauncher-commandrunner", - "url": "https://github.com/IkorJefocur/ulauncher-commandrunner", - "updated_at": "2024-01-14T19:58:09.331459", - "last_commit": "c306301468cbaba23625bf0ef0639b7ad6602783", - "last_commit_time": "2022-03-01T19:34:35" - }, - "com.github.melianmiko.ulauncher-nmcli": { - "id": "com.github.melianmiko.ulauncher-nmcli", - "url": "https://github.com/melianmiko/ulauncher-nmcli", - "updated_at": "2024-01-15T11:00:03.423007", - "last_commit": "fe967c947748616df602c9d022fec6d68a6b2cf2", - "last_commit_time": "2022-05-01T12:20:38" - }, - "com.github.tevenfeng.ulauncher-dc": { - "id": "com.github.tevenfeng.ulauncher-dc", - "url": "https://github.com/tevenfeng/ulauncher-dc", - "updated_at": "2024-01-15T11:00:14.588647", - "last_commit": "4cdeb58b1f79b64f2f6e3b4eecc3a38b81c886ea", - "last_commit_time": "2022-06-16T09:10:28" - }, - "com.github.fajtak.ulauncher-weather": { - "id": "com.github.fajtak.ulauncher-weather", - "url": "https://github.com/fajtak/ulauncher-weather", - "updated_at": "2024-01-15T11:03:08.154706", - "last_commit": "996da704e505776753f6340755d20f03075c2be8", - "last_commit_time": "2022-04-05T18:23:30" - }, - "com.github.isacikgoz.ukill": { - "id": "com.github.isacikgoz.ukill", - "url": "https://github.com/isacikgoz/ukill", - "updated_at": "2024-01-15T11:07:55.208352", - "last_commit": "bc50d9f41d46b6813a5aeebddd15734dcdb9d8db", - "last_commit_time": "2019-05-28T18:30:00" - }, - "com.github.frdrk.ulauncher-dead-simple-convert": { - "id": "com.github.frdrk.ulauncher-dead-simple-convert", - "url": "https://github.com/frdrk/ulauncher-dead-simple-convert", - "updated_at": "2024-01-15T11:29:28.766027", - "last_commit": "c0821e83b6c1d5a4984ef72c82e54eb21d0149ac", - "last_commit_time": "2023-10-03T11:40:03" - }, - "com.github.brpaz.ulauncher-currency": { - "id": "com.github.brpaz.ulauncher-currency", - "url": "https://github.com/brpaz/ulauncher-currency", - "updated_at": "2024-01-15T11:29:58.066495", - "last_commit": "262ed206057d38cec97e94297ab94246a43468cd", - "last_commit_time": "2021-12-12T15:45:10" - }, - "com.github.dflock.ulauncher-window-switcher": { - "id": "com.github.dflock.ulauncher-window-switcher", - "url": "https://github.com/dflock/ulauncher-window-switcher", - "updated_at": "2024-01-15T13:58:08.459425", - "last_commit": "54622e353a7d2d0421250a76cab4aafa9ca720c5", - "last_commit_time": "2022-01-16T17:56:00" - }, - "com.github.friday.ulauncher-clipboard": { - "id": "com.github.friday.ulauncher-clipboard", - "url": "https://github.com/friday/ulauncher-clipboard", - "updated_at": "2024-01-28T12:22:40.891939", - "last_commit": "dde8e6c9db80b0c9301ebdc9b13c4383b4789bc8", - "last_commit_time": "2023-11-27T22:23:17" - }, - "com.github.hillaryychan.ulauncher-fzf": { - "id": "com.github.hillaryychan.ulauncher-fzf", - "url": "https://github.com/hillaryychan/ulauncher-fzf", - "updated_at": "2024-01-28T16:28:14.218521", - "last_commit": "e8137dae6448041fc53ae418263501b068857073", - "last_commit_time": "2023-05-16T12:35:35" - } -} -\ No newline at end of file + "com.github.ulauncher.ulauncher-emoji": { + "id": "com.github.ulauncher.ulauncher-emoji", + "url": "https://github.com/Ulauncher/ulauncher-emoji", + "updated_at": "2024-01-14T19:38:55.565827", + "last_commit": "827cfe5e1d2f89f742f811f981759787b0654fa9", + "last_commit_time": "2023-11-04T18:37:13" + }, + "com.github.iboyperson.ulauncher-system": { + "id": "com.github.iboyperson.ulauncher-system", + "url": "https://github.com/iboyperson/ulauncher-system", + "updated_at": "2024-01-14T19:40:03.269429", + "last_commit": "7dedd992709fa2297735cddf852404144d4da47c", + "last_commit_time": "2023-11-14T16:53:20" + }, + "com.github.ulauncher.ulauncher-timer": { + "id": "com.github.ulauncher.ulauncher-timer", + "url": "https://github.com/ulauncher/ulauncher-timer", + "updated_at": "2024-01-14T19:40:27.342707", + "last_commit": "2d3fe82fe1e38670e6eb8887cd2a4b4d1c2baa79", + "last_commit_time": "2023-03-25T08:07:41" + }, + "com.github.nastuzzisamy.ulauncher-custom-scripts": { + "id": "com.github.nastuzzisamy.ulauncher-custom-scripts", + "url": "https://github.com/NastuzziSamy/ulauncher-custom-scripts", + "updated_at": "2024-01-14T19:40:48.262263", + "last_commit": "7a68cbafb4acc01fed340d0d2ae99a6701724b31", + "last_commit_time": "2022-11-21T21:19:31" + }, + "com.github.ikorjefocur.ulauncher-commandrunner": { + "id": "com.github.ikorjefocur.ulauncher-commandrunner", + "url": "https://github.com/IkorJefocur/ulauncher-commandrunner", + "updated_at": "2024-01-14T19:58:09.331459", + "last_commit": "c306301468cbaba23625bf0ef0639b7ad6602783", + "last_commit_time": "2022-03-01T19:34:35" + }, + "com.github.melianmiko.ulauncher-nmcli": { + "id": "com.github.melianmiko.ulauncher-nmcli", + "url": "https://github.com/melianmiko/ulauncher-nmcli", + "updated_at": "2024-01-15T11:00:03.423007", + "last_commit": "fe967c947748616df602c9d022fec6d68a6b2cf2", + "last_commit_time": "2022-05-01T12:20:38" + }, + "com.github.tevenfeng.ulauncher-dc": { + "id": "com.github.tevenfeng.ulauncher-dc", + "url": "https://github.com/tevenfeng/ulauncher-dc", + "updated_at": "2024-01-15T11:00:14.588647", + "last_commit": "4cdeb58b1f79b64f2f6e3b4eecc3a38b81c886ea", + "last_commit_time": "2022-06-16T09:10:28" + }, + "com.github.fajtak.ulauncher-weather": { + "id": "com.github.fajtak.ulauncher-weather", + "url": "https://github.com/fajtak/ulauncher-weather", + "updated_at": "2024-01-15T11:03:08.154706", + "last_commit": "996da704e505776753f6340755d20f03075c2be8", + "last_commit_time": "2022-04-05T18:23:30" + }, + "com.github.isacikgoz.ukill": { + "id": "com.github.isacikgoz.ukill", + "url": "https://github.com/isacikgoz/ukill", + "updated_at": "2024-01-15T11:07:55.208352", + "last_commit": "bc50d9f41d46b6813a5aeebddd15734dcdb9d8db", + "last_commit_time": "2019-05-28T18:30:00" + }, + "com.github.frdrk.ulauncher-dead-simple-convert": { + "id": "com.github.frdrk.ulauncher-dead-simple-convert", + "url": "https://github.com/frdrk/ulauncher-dead-simple-convert", + "updated_at": "2024-01-15T11:29:28.766027", + "last_commit": "c0821e83b6c1d5a4984ef72c82e54eb21d0149ac", + "last_commit_time": "2023-10-03T11:40:03" + }, + "com.github.brpaz.ulauncher-currency": { + "id": "com.github.brpaz.ulauncher-currency", + "url": "https://github.com/brpaz/ulauncher-currency", + "updated_at": "2024-01-15T11:29:58.066495", + "last_commit": "262ed206057d38cec97e94297ab94246a43468cd", + "last_commit_time": "2021-12-12T15:45:10" + }, + "com.github.dflock.ulauncher-window-switcher": { + "id": "com.github.dflock.ulauncher-window-switcher", + "url": "https://github.com/dflock/ulauncher-window-switcher", + "updated_at": "2024-01-15T13:58:08.459425", + "last_commit": "54622e353a7d2d0421250a76cab4aafa9ca720c5", + "last_commit_time": "2022-01-16T17:56:00" + }, + "com.github.friday.ulauncher-clipboard": { + "id": "com.github.friday.ulauncher-clipboard", + "url": "https://github.com/friday/ulauncher-clipboard", + "updated_at": "2024-01-28T12:22:40.891939", + "last_commit": "dde8e6c9db80b0c9301ebdc9b13c4383b4789bc8", + "last_commit_time": "2023-11-27T22:23:17" + }, + "com.github.hillaryychan.ulauncher-fzf": { + "id": "com.github.hillaryychan.ulauncher-fzf", + "url": "https://github.com/hillaryychan/ulauncher-fzf", + "updated_at": "2024-01-28T16:28:14.218521", + "last_commit": "e8137dae6448041fc53ae418263501b068857073", + "last_commit_time": "2023-05-16T12:35:35" + } +} diff --git a/files/ulauncher/settings/scripts.json b/files/ulauncher/settings/scripts.json @@ -1,5 +1,10 @@ [ { + "name": "Clear Clipboard", + "icon": "clipboard", + "script": "sh -c 'echo [] | cat > ~/.local/share/clipman.json'" + }, + { "name": "Documentation", "description": "ULauncher Documentation", "icon": "help-about", diff --git a/flake.lock b/flake.lock @@ -842,11 +842,11 @@ }, "unstable": { "locked": { - "lastModified": 1705856552, - "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { diff --git a/modules/README.md b/modules/README.md @@ -28,6 +28,7 @@ Configuration [Builder](./configuration.nix) - `desktop`: Choice of GUI Desktop - `"gnome" / "xfce" / "pantheon"` - `wallpaper`: Desktop Wallpaper Choice (taken from `files.wallpapers`) + - `fancy`: Enable Fancy GUI Effects - `true / false` - `fonts` - - `enable`: Enable Fonts Configuration - `true / false` - `icons` - @@ -36,6 +37,7 @@ Configuration [Builder](./configuration.nix) - `cursors` - - `name`: GUI Cursors Theme - Ex. `Bibata` - `package`: Cursors Package - Ex. `pkgs.bibata-cursors` + - `size`: Cursors Size - Ex. `28` - `gtk` - - `enable`: Enable GTK Configuration - `true / false` - `theme` - diff --git a/modules/apps/firefox.nix b/modules/apps/firefox.nix @@ -51,6 +51,7 @@ in { builtins.listToAttrs [ (extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}") (extension "setupvpn" "@setupvpncom") + (extension "stylus" "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}") (extension "tabliss" "extension@tabliss.io") (extension "uaswitcher" "user-agent-switcher@ninetailed.ninja") (extension "ublock-origin" "uBlock0@raymondhill.net") diff --git a/modules/apps/games.nix b/modules/apps/games.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (lib) mkIf; + inherit (lib) mkForce mkIf; enable = builtins.elem "games" config.apps.list; wine = builtins.elem "wine" config.apps.list; in { @@ -38,6 +38,8 @@ in { # Game Mode # See https://github.com/FeralInteractive/gamemode + hardware.cpu.mode = mkForce "performance"; + gui.fancy = mkForce false; programs.gamemode.enable = true; }; } diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -7,15 +7,18 @@ }: let inherit (builtins) map; inherit (util.map.modules) list name; - inherit (lib) hasSuffix mkIf mkOption optional types; + inherit (lib) hasSuffix mkEnableOption mkIf mkOption optional types; inherit (config.gui) desktop; in { imports = list ./. ++ list ./desktop; - options.gui.desktop = mkOption { - description = "GUI Desktop Choice"; - type = types.enum ((name ./desktop) ++ map (x: x + "-minimal") (name ./desktop) ++ [""]); - default = ""; + options.gui = { + fancy = mkEnableOption "Enable Fancy GUI Effects"; + desktop = mkOption { + description = "GUI Desktop Choice"; + type = types.enum ((name ./desktop) ++ map (x: x + "-minimal") (name ./desktop) ++ [""]); + default = ""; + }; }; config = diff --git a/modules/gui/desktop/gnome.nix b/modules/gui/desktop/gnome.nix @@ -84,10 +84,10 @@ in { }; }; + apps.list = ["firefox"]; programs = { gnupg.agent.pinentryFlavor = mkForce "gnome3"; firefox = { - enable = true; policies.ExtensionSettings = { name = "gnome-shell-integration"; value = { @@ -141,7 +141,7 @@ in { # Discord DNOME Theme ".config/BetterDiscord/data/stable/custom.css" = - mkIf (exists "discord") {text = ''@import "https://raw.githack.com/GeopJr/DNOME/dist/DNOME.css";'';}; + mkIf (exists "discord") {text = ''@import url("https://raw.githack.com/GeopJr/DNOME/dist/DNOME.css");'';}; }; # Code Editor diff --git a/modules/gui/desktop/hyprland/apps.nix b/modules/gui/desktop/hyprland/apps.nix @@ -1,268 +0,0 @@ -{ - config, - lib, - util, - pkgs, - files, - ... -}: -with files; let - inherit (config.stylix) fonts; - inherit (config.gui) wallpaper; - exists = app: builtins.elem app config.apps.list; - theme = import ./theme.nix pkgs; -in { - environment.systemPackages = with pkgs; [ - # Apps - geany - gthumb - lollypop - mate.atril - mission-center - playerctl - qalculate-gtk - transmission-gtk - xfce.thunar - - # Utilities - grim - grimblast - slurp - wev - wl-clipboard - wl-screenrec - wlr-randr - ]; - - user = { - # Persisted Files - persist.directories = [ - ".config/geany" - ".config/mpv" - ".config/Thunar" - ".local/share/lollypop" - ]; - - homeConfig = { - # Default Applications - xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime { - audio = ["org.gnome.Lollypop.desktop"]; - directory = ["thunar.desktop"]; - image = ["org.gnome.gThumb.desktop"]; - magnet = ["transmission-gtk.desktop"]; - pdf = ["atril.desktop"]; - text = ["geany.desktop"]; - video = ["mpv.desktop"]; - }; - - # Theming - stylix.targets = { - hyprland.enable = true; - dunst.enable = true; - swaylock = { - enable = true; - useImage = true; - }; - }; - - # Configuration Files - home.file = { - # Wallpaper - ".config/hypr/hyprpaper.conf".text = '' - preload = ${wallpaper} - wallpaper = , ${wallpaper} - ''; - - # Text Editor - ".config/geany/geany.conf".text = geany.settings; - ".config/geany/colorschemes/theme.conf".text = geany.catppuccin; - - # Terminal - ".config/kitty/search".source = pkgs.custom.kitty-search; - - # File Manager - ".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".text = xfce.settings.thunar; - }; - - # Utilities - services.playerctld.enable = true; - - # Terminal - wayland.windowManager.hyprland.settings.misc.swallow_regex = " ^(kitty)$"; - programs.kitty = { - enable = true; - font = fonts.monospace // {size = fonts.sizes.terminal;}; - theme = with theme; "${name-alt}-${variant-alt}"; - keybindings = { - "ctrl+c" = "copy_or_interrupt"; - "kitty_mod+f" = "launch --allow-remote-control kitty +kitten search/search.py @active-kitty-window-id"; - }; - - settings = { - kitty_mod = "ctrl+shift"; - background_opacity = "0.9"; - placement_strategy = "center"; - - copy_on_select = "clipboard"; - scrollback_lines = 10000; - - enable_audio_bell = "no"; - visual_bell_duration = "0.1"; - }; - }; - - # Web Browser - programs.firefox = { - enable = true; - policies.ExtensionSettings = { - name = with theme; "${name}-${variant}-${accent}"; - value = { - installation_mode = "normal_installed"; - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/{d49033ac-8969-488c-afb0-5cdb73957f41}/latest.xpi"; - }; - }; - }; - - # Media - programs.mpv = { - enable = true; - defaultProfiles = ["gpu-hq"]; - scripts = [pkgs.mpvScripts.mpris]; - }; - - # Notifications - services.dunst = { - enable = true; - iconTheme = theme.icons; - settings = { - fullscreen_delay_everything = {fullscreen = "delay";}; - global = { - alignment = "center"; - corner_radius = 10; - follow = "mouse"; - format = "<b>%s</b>\\n%b"; - frame_width = 1; - offset = "5x5"; - horizontal_padding = 8; - icon_position = "left"; - indicate_hidden = "yes"; - markup = "yes"; - max_icon_size = 64; - mouse_left_click = "do_action"; - mouse_middle_click = "close_all"; - mouse_right_click = "close_current"; - padding = 8; - plain_text = "no"; - separator_height = 1; - show_indicators = false; - shrink = "no"; - word_wrap = "yes"; - }; - }; - }; - - # Locker - programs.swaylock = { - enable = true; - package = pkgs.swaylock-effects; - settings = { - clock = true; - indicator = true; - font = fonts.sansSerif.name; - grace = 10; - fade-in = 1; - effect-vignette = "0.3:1"; - }; - }; - - # Screen Idle - services.swayidle = { - enable = true; - events = [ - { - event = "before-sleep"; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - { - event = "lock"; - command = "${pkgs.swaylock-effects}/bin/swaylock -f"; - } - ]; - timeouts = [ - { - timeout = 330; - command = "${pkgs.writeShellApplication { - name = "suspend"; # Only suspend if no audio is playing - runtimeInputs = with pkgs; [pipewire ripgrep systemd]; - text = '' - pw-cli i all | rg running - if [ $? == 1 ] - then - ${pkgs.systemd}/bin/systemctl suspend - fi - ''; - }}/bin/suspend"; - } - ]; - }; - - systemd.user.services = { - # Wallpaper Daemon - hyprpaper = { - Install.WantedBy = ["graphical-session.target"]; - Unit = { - Description = "Hyprland Wallpaper Daemon"; - PartOf = ["graphical-session.target"]; - }; - - Service = { - ExecStart = "${lib.getExe pkgs.hyprpaper}"; - Restart = "on-failure"; - }; - }; - - # Authorization Agent - polkit = { - Unit.Description = "polkit-gnome-authentication-agent-1"; - - Install = { - WantedBy = ["graphical-session.target"]; - Wants = ["graphical-session.target"]; - After = ["graphical-session.target"]; - }; - - Service = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; - }; - - ## 3rd Party Apps Configuration - # Code Editor - programs.vscode = lib.mkIf (exists "vscode") { - extensions = with pkgs; [ - vscode-extensions.catppuccin.catppuccin-vsc-icons - (catppuccin-vsc.override { - inherit (theme) accent; - boldKeywords = true; - italicComments = true; - italicKeywords = true; - extraBordersEnabled = false; - workbenchMode = "default"; - bracketMode = "rainbow"; - }) - ]; - - userSettings = with theme; { - "workbench.colorTheme" = "${name-alt} ${variant-alt}"; - "workbench.iconTheme" = "${name}-${variant}"; - "terminal.external.linuxExec" = "kitty"; - }; - }; - }; - }; -} diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -0,0 +1,252 @@ +{ + sys, + lib, + pkgs, + files, + ... +}: let + theme = import ../theme.nix pkgs; +in rec { + ## Bar Configuration + stylix.targets.waybar = { + enable = true; + enableCenterBackColors = true; + enableLeftBackColors = true; + enableRightBackColors = true; + }; + + # Environment Setup + home.packages = [pkgs.font-awesome]; + systemd.user = { + # nix-community/home-manager/4099 + services.waybar.Service.ExecStart = lib.mkForce (pkgs.writeShellScript "waybar-wrapper.sh" '' + ${files.path.systemd} + ${programs.waybar.package}/bin/waybar + ''); + + # nix-community/home-manager/2064 + targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = ["graphical-session-pre.target"]; + }; + }; + }; + + programs.waybar = { + enable = true; + systemd.enable = true; + + package = pkgs.waybar.overrideAttrs (old: { + version = "hypr"; + nativeCheckInputs = [pkgs.unstable.catch2_3]; + src = pkgs.fetchFromGitHub { + owner = "Syndelis"; + repo = "Waybar"; + rev = "1bf97f532e5aac74fe9e9ca61500c3e26b14422f"; + sha256 = "sha256-kAaMoFqaJ9qUVztpLJWiZAq/EKHuhJFBbGyuGbINq/U="; + }; + }); + + style = '' + * { + font-family: ${sys.stylix.fonts.sansSerif.name}, "Font Awesome 6 Free"; + font-size: 16px; + font-weight: 500; + border-radius: 10px; + } + + #waybar.empty #window { + background: none; + } + + #backlight, + #battery, + #bluetooth, + #keyboard-state, + #network, + #taskbar, + #tray, + #window, + #wireplumber, + #workspaces { + padding: 1px 6px 1px 6px; + } + + #network { + padding-right: 11px; + } + ''; + + # Panel + settings = [ + { + layer = "top"; + position = "top"; + output = ["eDP-1"]; + + spacing = 3; + margin-top = 3; + margin-left = 5; + margin-right = 5; + margin-bottom = 5; + + modules-left = ["hyprland/workspaces" "hyprland/window"]; + modules-center = ["wlr/taskbar"]; + modules-right = [ + "tray" + "bluetooth" + "network" + "keyboard-state" + "backlight" + "wireplumber" + "battery" + "clock" + ]; + + "hyprland/workspaces" = { + all-outputs = true; + show-special = true; + format = "{icon}"; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; + format-icons = { + default = ""; + "1" = ""; + "2" = ""; + "3" = ""; + "4" = "🖧"; + "5" = ""; + "6" = ""; + "7" = ""; + "8" = ""; + "9" = ""; + "10" = ""; + special = ""; + }; + + persistent-workspaces = { + "*" = 3; + }; + }; + + "hyprland/window" = { + format = "{initialTitle}"; + max-length = 40; + separate-outputs = true; + rewrite = { + "bash" = "Terminal"; + "zsh" = "Terminal"; + "(.*) - kitty" = "Terminal"; + }; + }; + + "wlr/taskbar" = { + format = "{icon}"; + icon-size = 16; + all-outputs = false; + icon-theme = theme.icons.name; + tooltip-format = "{title}"; + on-click = "activate"; + on-click-middle = "close"; + }; + + tray = { + icon-size = 14; + spacing = 8; + }; + + bluetooth = { + format = ""; + format-disabled = "󰂳"; + format-connected = "󰂱 {num_connections}"; + tooltip-format = " {status}"; + tooltip-format-connected = "{device_enumerate}"; + tooltip-format-enumerate-connected = " {device_alias} 󰂄 {device_battery_percentage}%"; + on-click = "blueberry"; + }; + + network = { + format = "{ifname}"; + format-disconnected = "󰌙"; + format-ethernet = "󰌘"; + format-wifi = "{icon}"; + format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + format-linked = "󰈁 {ifname}"; + tooltip-format = "Network= <big><b>{essid}</b></big>\nStrength= <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency= <b>{frequency}MHz</b>\nInterface= <b>{ifname}</b>\nIP= <b>{ipaddr}/{cidr}</b>\nGateway= <b>{gwaddr}</b>\nNetmask= <b>{netmask}</b>"; + tooltip-format-disconnected = "󰌙 Disconnected"; + on-click = "nmtui"; + }; + + keyboard-state = { + numlock = true; + capslock = false; + format.numlock = "NUM {icon}"; + format-icons = { + locked = ""; + unlocked = "*"; + }; + }; + + backlight = { + format = "{icon}"; + tooltip-format = "Backlight {percent}%"; + format-icons = ["" "" "" "" "" "" "" "" ""]; + on-scroll-down = "${pkgs.brillo}/bin/brillo -u 300000 -A 5"; + on-scroll-up = "${pkgs.brillo}/bin/brillo -u 300000 -U 5"; + }; + + wireplumber = { + max-volume = 150; + scroll-step = 1; + format = "{icon} {volume}%"; + format-muted = " Mute"; + format-icons = ["" "" "󰕾" ""]; + }; + + battery = { + interval = 10; + align = 0; + rotate = 0; + format = "{icon}"; + tooltip-format = "Battery {capacity}%"; + format-charging = ""; + format-icons = ["" "" "" "" ""]; + states = { + good = 80; + warning = 20; + critical = 10; + }; + }; + + clock = { + interval = 1; + format = " {:%H:%M:%S}"; + format-alt = " {:%I:%M  %Y, %d %B, %A}"; + tooltip-format = "<tt><small>{calendar}</small></tt>"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "left"; + on-scroll = 1; + format = { + months = "<span color='#FFEAD3'><b>{}</b></span>"; + days = "<span color='#ECC6D9'><b>{}</b></span>"; + weeks = "<span color='#99FFDD'><b>W{}</b></span>"; + weekdays = "<span color='#FFCC66'><b>{}</b></span>"; + today = "<span color='#FF6699'><b><u>{}</u></b></span>"; + }; + }; + }; + + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + } + ]; + }; +} diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -0,0 +1,213 @@ +{ + config, + lib, + util, + pkgs, + files, + ... +}: +with files; let + inherit (config.gui) wallpaper; + inherit (lib) getExe mkIf; + exists = app: builtins.elem app config.apps.list; + theme = import ../theme.nix pkgs; +in { + apps.list = ["firefox"]; + gui.launcher.terminal = "kitty"; + environment.systemPackages = with pkgs; [ + # Apps + geany + gthumb + lollypop + mate.atril + mission-center + playerctl + qalculate-gtk + transmission-gtk + xfce.thunar + + # Utilities + blueberry + grim + grimblast + slurp + wev + wl-clipboard + wl-screenrec + wlr-randr + ]; + + user = { + # Persisted Files + persist.directories = [ + ".config/geany" + ".config/mpv" + ".config/Thunar" + ".local/share/lollypop" + ]; + + homeConfig = { + imports = util.map.modules.list ./.; + + # Default Applications + xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime { + audio = ["org.gnome.Lollypop.desktop"]; + directory = ["thunar.desktop"]; + image = ["org.gnome.gThumb.desktop"]; + magnet = ["transmission-gtk.desktop"]; + pdf = ["atril.desktop"]; + text = ["geany.desktop"]; + video = ["mpv.desktop"]; + }; + + # Shortcuts + wayland.windowManager.hyprland.settings.bind = [ + "$mod, F, exec, thunar" + "$mod, T, exec, kitty" + "$mod, W, exec, firefox" + "$mod, Return, exec, missioncenter" + "$mod, slash, exec, ulauncher-toggle" + ", XF86Calculator, exec, qalculate-gtk" + ]; + + # Utilities + services.playerctld.enable = true; + + # Terminal + wayland.windowManager.hyprland.settings.misc.swallow_regex = " ^(kitty)$"; + programs.kitty = { + enable = true; + font = with config.stylix.fonts; monospace // {size = sizes.terminal;}; + theme = with theme; "${name-alt}-${variant-alt}"; + keybindings = { + "ctrl+c" = "copy_or_interrupt"; + "kitty_mod+f" = "launch --allow-remote-control kitty +kitten search/search.py @active-kitty-window-id"; + }; + + settings = { + kitty_mod = "ctrl+shift"; + background_opacity = "0.9"; + placement_strategy = "center"; + + copy_on_select = "clipboard"; + scrollback_lines = 10000; + + enable_audio_bell = "no"; + visual_bell_duration = "0.1"; + }; + }; + + # Web Browser + programs.firefox = { + policies.ExtensionSettings = { + name = with theme; "${name}-${variant}-${accent}"; + value = { + installation_mode = "normal_installed"; + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/{d49033ac-8969-488c-afb0-5cdb73957f41}/latest.xpi"; + }; + }; + }; + + # Media + programs.mpv = { + enable = true; + defaultProfiles = ["gpu-hq"]; + scripts = [pkgs.mpvScripts.mpris]; + }; + + # Notifications + stylix.targets.dunst.enable = true; + services.dunst = { + enable = true; + iconTheme = theme.icons; + settings = { + fullscreen_delay_everything = {fullscreen = "delay";}; + global = { + alignment = "center"; + corner_radius = 10; + follow = "mouse"; + format = "<b>%s</b>\\n%b"; + frame_width = 1; + offset = "5x5"; + horizontal_padding = 8; + icon_position = "left"; + indicate_hidden = "yes"; + markup = "yes"; + max_icon_size = 64; + mouse_left_click = "do_action"; + mouse_middle_click = "close_all"; + mouse_right_click = "close_current"; + padding = 8; + plain_text = "no"; + separator_height = 1; + show_indicators = false; + shrink = "no"; + word_wrap = "yes"; + }; + }; + }; + + # Wallpaper Daemon + systemd.user.services.hyprpaper = { + Install.WantedBy = ["graphical-session.target"]; + Unit = { + Description = "Hyprland Wallpaper Daemon"; + PartOf = ["graphical-session.target"]; + }; + + Service = { + ExecStart = "${getExe pkgs.hyprpaper}"; + Restart = "on-failure"; + }; + }; + + # Configuration Files + home.file = + { + # Wallpaper + ".config/hypr/hyprpaper.conf".text = '' + preload = ${wallpaper} + wallpaper = , ${wallpaper} + ''; + + # Text Editor + ".config/geany/geany.conf".text = geany.settings; + ".config/geany/colorschemes/theme.conf".text = geany.catppuccin; + + # Terminal + ".config/kitty/search".source = pkgs.custom.kitty-search; + + # File Manager + ".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".text = xfce.settings.thunar; + } + ## 3rd Party Apps Configuration + // { + # Discord Chat + ".config/BetterDiscord/data/stable/custom.css" = with theme; + mkIf (exists "discord") {text = ''@import url("https://${name}.github.io/discord/dist/${name}-${variant}-${accent}.theme.css");'';}; + }; + + # Code Editor + programs.vscode = mkIf (exists "vscode") { + extensions = with pkgs; [ + vscode-extensions.catppuccin.catppuccin-vsc-icons + (catppuccin-vsc.override { + inherit (theme) accent; + boldKeywords = true; + italicComments = true; + italicKeywords = true; + extraBordersEnabled = false; + workbenchMode = "default"; + bracketMode = "rainbow"; + }) + ]; + + userSettings = with theme; { + "workbench.colorTheme" = "${name-alt} ${variant-alt}"; + "workbench.iconTheme" = "${name}-${variant}"; + "terminal.external.linuxExec" = "kitty"; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/hyprland/apps/security.nix b/modules/gui/desktop/hyprland/apps/security.nix @@ -0,0 +1,77 @@ +{ + sys, + pkgs, + ... +}: let + inherit (sys.stylix) fonts; +in { + # Locker + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + clock = true; + indicator = true; + font = fonts.sansSerif.name; + grace = 10; + fade-in = 1; + effect-vignette = "0.3:1"; + }; + }; + + # Theming + stylix.targets.swaylock = { + enable = true; + useImage = true; + }; + + # Screen Idle + services.swayidle = { + enable = true; + events = [ + { + event = "before-sleep"; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + { + event = "lock"; + command = "${pkgs.swaylock-effects}/bin/swaylock -f"; + } + ]; + timeouts = [ + { + timeout = 330; + command = "${pkgs.writeShellApplication { + name = "suspend"; # Only suspend if no audio is playing + runtimeInputs = with pkgs; [pipewire ripgrep systemd]; + text = '' + pw-cli i all | rg running + if [ $? == 1 ] + then + ${pkgs.systemd}/bin/systemctl suspend + fi + ''; + }}/bin/suspend"; + } + ]; + }; + + # Authorization Agent + systemd.user.services.polkit = { + Unit.Description = "polkit-gnome-authentication-agent-1"; + + Install = { + WantedBy = ["graphical-session.target"]; + Wants = ["graphical-session.target"]; + After = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; +} diff --git a/modules/gui/desktop/hyprland/binds.nix b/modules/gui/desktop/hyprland/binds.nix @@ -1,110 +0,0 @@ -_: { - ## Keybindings - wayland.windowManager.hyprland.settings = { - "$mod" = "SUPER"; - bind = - [ - # Apps - "$mod, F, exec, thunar" - "$mod, T, exec, kitty" - "$mod, W, exec, firefox" - "$mod, Return, exec, missioncenter" - "$mod, slash, exec, ulauncher-toggle" - ", XF86Calculator, exec, qalculate-gtk" - - # Compositor Commands - "$mod, Q, killactive," - "$mod, M, fullscreen, 1" - "$mod SHIFT, M, fullscreen," - "$mod, O, togglefloating," - "$mod, P, workspaceopt, allfloat" # Floating Mode - - # Focus Change - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - - # Window Switcher - "ALT, Tab, cyclenext," - "ALT, Tab, bringactivetotop," - "ALT CTRL, Tab, cyclenext, prev" - "ALT CTRL, Tab, bringactivetotop," - - # Cycle Workspaces - "$mod, period, workspace, m-1" - "$mod, comma, workspace, m+1" - - # Special Workspace - "$mod SHIFT, grave, movetoworkspace, special" - "$mod, grave, togglespecialworkspace, eDP-1" - - # Move Window to Workspace - "$mod SHIFT, period, movetoworkspace, m-1" - "$mod SHIFT, comma, movetoworkspace, m+1" - - # Cycle Monitors - "$mod SHIFT, period, focusmonitor, l" - "$mod SHIFT, comma, focusmonitor, r" - - # Send Focused Workspace to Monitor - "$mod SHIFT CTRL, period, movecurrentworkspacetomonitor, l" - "$mod SHIFT CTRL, comma, movecurrentworkspacetomonitor, r" - - # Screen Lock - "$mod, L, exec, loginctl lock-session" - - # Screenshot - ", Print, exec, grimblast --notify copysave area" - "CTRL, Print, exec, grimblast --notify --cursor copysave output" - "SHIFT, Print, exec, grimblast --notify --cursor copysave screen" - - # Magnifier - ''$mod, equal, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 + 1}')"'' - ''$mod, minus, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 - 1}')"'' - ] - ++ - # Workspaces - (with builtins; - concatLists (genList ( - num: let - key = toString (num + 1 - (((num + 1) / 10) * 10)); - workspace = toString (num + 1); - in [ - "$mod, ${key}, workspace, ${workspace}" - "$mod SHIFT, ${key}, movetoworkspace, ${workspace}" - ] - ) - 10)); - - # Mouse - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - "$mod CTRL, mouse:272, resizewindow" - ]; - - # Ignore Locked State - bindl = [ - # Media Controls - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPrev, exec, playerctl previous" - ", XF86AudioNext, exec, playerctl next" - - # Volume - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - ]; - - # Repeat on Hold - bindle = [ - # Volume - ", XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-" - - # Backlight - ", XF86MonBrightnessUp, exec, brillo -q -u 300000 -A 5" - ", XF86MonBrightnessDown, exec, brillo -q -u 300000 -U 5" - ]; - }; -} diff --git a/modules/gui/desktop/hyprland/default.nix b/modules/gui/desktop/hyprland/default.nix @@ -6,11 +6,9 @@ ... } @ args: let inherit (config.gui) desktop; - inherit (config.stylix) cursor fonts; inherit (lib) mkIf mkMerge; theme = import ./theme.nix pkgs; in { - #!# WIP #!# ## Hyprland Configuration ## config = mkIf (desktop == "hyprland" || desktop == "hyprland-minimal") (mkMerge [ { @@ -41,7 +39,7 @@ in { }; } - (mkIf (desktop == "hyprland") (import ./apps.nix args)) + (mkIf (desktop == "hyprland") (import ./apps args)) (mkIf (desktop == "hyprland") { # Boot Splash boot.plymouth = { @@ -49,7 +47,11 @@ in { themePackages = [pkgs.catppuccin-plymouth]; }; + # Settings + user.homeConfig.imports = [./settings]; + # Desktop Integration + stylix.base16Scheme = files.colors.catppuccin; gui = with theme; { fonts.enable = true; inherit (theme) icons; @@ -68,25 +70,23 @@ in { enable = true; shadow = false; theme = theme.name; - terminal = "kitty"; }; }; - # Security - security.pam.services = { - greetd.enableGnomeKeyring = true; - swaylock.text = "auth include login"; - }; - ## Essential Utilities xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk]; + services = { + # Battery + power-profiles-daemon.enable = true; + upower.enable = true; - # Battery - services.power-profiles-daemon.enable = true; - services.upower.enable = true; + # Location + geoclue2.enable = true; + }; + location.provider = "geoclue2"; # Greeter - programs.regreet.settings.GTK = { + programs.regreet.settings.GTK = with config.stylix; { application_prefer_dark_theme = true; cursor_theme_name = cursor.name; font_name = "${fonts.sansSerif.name} 16"; @@ -95,120 +95,13 @@ in { }; # Backlight - user.groups = ["video"]; + user.groups = ["input" "video"]; hardware.brillo.enable = true; - services.clight = { - enable = true; - settings = { - verbose = true; - backlight.disabled = true; - dpms.timeouts = [900 300]; - dimmer.timeouts = [870 270]; - gamma.long_transition = true; - screen.disabled = true; - }; - }; - - # Location - location.provider = "geoclue2"; - services.geoclue2.enable = true; - # Color Scheme - stylix.base16Scheme = files.colors.catppuccin; - - ## User Configuration - user.homeConfig = { - imports = [./binds.nix ./rules.nix]; - - ## Settings - wayland.windowManager.hyprland = { - enable = true; - settings = { - env = ["QT_WAYLAND_DISABLE_WINDOWDECORATION,1"]; - debug.disable_logs = false; - exec-once = [ - "hyprctl setcursor ${cursor.name} ${builtins.toString cursor.size}" - "systemctl --user start clight" - ]; - - # Display - monitor = ",preferred,auto,1"; - xwayland.force_zero_scaling = true; - - input = { - # Keyboard - kb_layout = "us"; - numlock_by_default = true; - - # Mouse - follow_mouse = 1; # Focus on cursor move - accel_profile = "flat"; - touchpad = { - disable_while_typing = true; - natural_scroll = true; - tap-to-click = true; - tap-and-drag = true; - }; - }; - - gestures = { - workspace_swipe = true; - workspace_swipe_fingers = 3; - workspace_swipe_forever = true; - }; - - # Tiling Layout - dwindle = { - pseudotile = true; # Keep floating dimensions - preserve_split = true; - }; - - misc = { - enable_swallow = true; - force_default_wallpaper = 0; - disable_hyprland_logo = true; - - # Prevent checking for configuration changes - # Use 'hyprctl reload' if required - disable_autoreload = true; - - # Graphics - vrr = 1; - no_direct_scanout = false; - }; - - general = - { - resize_on_border = true; - allow_tearing = config.hardware.cpu.mode == "powersave"; - } - // - # Visuals - { - gaps_in = 5; - gaps_out = 5; - border_size = 3; - }; - - decoration = { - rounding = 10; - drop_shadow = true; - shadow_ignore_window = true; - shadow_offset = "0 2"; - shadow_range = 20; - shadow_render_power = 3; - - blur = { - enabled = true; - brightness = 1.0; - contrast = 1.0; - noise = 0.02; - passes = 3; - size = 10; - }; - }; - }; - }; + # Security + security.pam.services = { + greetd.enableGnomeKeyring = true; + swaylock.text = "auth include login"; }; }) ]); diff --git a/modules/gui/desktop/hyprland/rules.nix b/modules/gui/desktop/hyprland/rules.nix @@ -1,24 +0,0 @@ -_: { - wayland.windowManager.hyprland.settings = { - # Window Rules - windowrulev2 = [ - # PiP Window - "float, title:^(Picture-in-Picture)$" - "pin, title:^(Picture-in-Picture)$" - - # Throw away Sharing Window - "workspace special silent, title:^(Firefox — Sharing Indicator)$" - "workspace special silent, title:^(.*is sharing (your screen|a window)\.)$" - - # Idle Inhibit during media consumption - "idleinhibit focus, class:^(mpv|.+exe)$" - "idleinhibit focus, class:^(firefox|google-chrome)$, title:^(.*YouTube.*)$" - "idleinhibit fullscreen, class:^(firefox|google-chrome)$" - - # Prompt Windows - "dimaround, class:^(gcr-prompter)$" - "dimaround, class:^(xdg-desktop-portal-gtk)$" - "dimaround, class:^(polkit-gnome-authentication-agent-1)$" - ]; - }; -} diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -0,0 +1,95 @@ +{ + sys, + lib, + util, + ... +}: { + ## Hyprland Settings + imports = util.map.modules.list ./.; + stylix.targets.hyprland.enable = true; + dconf.settings."org/gnome/desktop/wm/preferences".button-layout = "appmenu"; + wayland.windowManager.hyprland = { + enable = true; + settings = { + debug.disable_logs = false; + env = ["QT_WAYLAND_DISABLE_WINDOWDECORATION,1"]; + + # Display + monitor = ",preferred,auto,1"; + xwayland.force_zero_scaling = true; + + input = { + # Keyboard + kb_layout = "us"; + numlock_by_default = true; + + # Mouse + follow_mouse = 1; # Focus on cursor move + accel_profile = "flat"; + touchpad = { + disable_while_typing = true; + natural_scroll = true; + tap-to-click = true; + tap-and-drag = true; + }; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_fingers = 3; + workspace_swipe_forever = true; + }; + + # Tiling Layout + dwindle = { + pseudotile = true; # Keep floating dimensions + preserve_split = true; + }; + + misc = { + enable_swallow = true; + + # Interfere with wallpaper daemons + force_default_wallpaper = 0; + disable_hyprland_logo = true; + + # Prevent checking for configuration changes + # Use 'hyprctl reload' if required + disable_autoreload = true; + + # Graphics + vrr = 1; + no_direct_scanout = false; + }; + + general = + { + resize_on_border = true; + allow_tearing = !sys.gui.fancy; + } + // + # Visuals + { + gaps_in = 5; + gaps_out = 5; + border_size = 2; + }; + + decoration = lib.mkIf sys.gui.fancy { + rounding = 10; + drop_shadow = true; + shadow_ignore_window = true; + shadow_offset = "0 2"; + shadow_range = 20; + dim_special = 0.3; + + blur = { + enabled = true; + brightness = 1.0; + contrast = 1.0; + passes = 2; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -0,0 +1,118 @@ +_: { + ## Keybindings + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + bind = + [ + # Compositor Commands + "$mod, Q, killactive," + "$mod, M, fullscreen, 1" + "$mod SHIFT, M, fullscreen," + + # Focus Change + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # Window Swap + "$mod SHIFT, left, swapwindow, l" + "$mod SHIFT, right, swapwindow, r" + "$mod SHIFT, up, swapwindow, u" + "$mod SHIFT, down, swapwindow, d" + + # Tiling + "$mod, Space, togglesplit" + "$mod SHIFT, Space, togglegroup" + "$mod, Tab, changegroupactive, f" + "$mod SHIFT, Tab, changegroupactive, b" + + # Floating Mode + "$mod, O, togglefloating," + "$mod, P, workspaceopt, allfloat" + "$mod, C, centerwindow" + + # Window Switcher + "ALT, Tab, cyclenext," + "ALT, Tab, bringactivetotop," + "ALT CTRL, Tab, cyclenext, prev" + "ALT CTRL, Tab, bringactivetotop," + + # Cycle Workspaces + "$mod, period, workspace, m-1" + "$mod, comma, workspace, m+1" + + # Special Workspace + "$mod SHIFT, grave, movetoworkspace, special" + "$mod, grave, togglespecialworkspace, eDP-1" + + # Move Window to Workspace + "$mod SHIFT, period, movetoworkspace, m-1" + "$mod SHIFT, comma, movetoworkspace, m+1" + + # Cycle Monitors + "$mod SHIFT, period, focusmonitor, l" + "$mod SHIFT, comma, focusmonitor, r" + + # Send Focused Workspace to Monitor + "$mod SHIFT CTRL, period, movecurrentworkspacetomonitor, l" + "$mod SHIFT CTRL, comma, movecurrentworkspacetomonitor, r" + + # Screen Lock + "$mod, L, exec, loginctl lock-session" + + # Screenshot + ", Print, exec, grimblast --notify copysave area" + "CTRL, Print, exec, grimblast --notify --cursor copysave output" + "SHIFT, Print, exec, grimblast --notify --cursor copysave screen" + + # Magnifier + ''$mod, equal, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 + 1}')"'' + ''$mod, minus, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 - 1}')"'' + ] + ++ + # Workspaces + (with builtins; + concatLists (genList ( + num: let + key = toString (num + 1 - (((num + 1) / 10) * 10)); + workspace = toString (num + 1); + in [ + "$mod, ${key}, workspace, ${workspace}" + "$mod SHIFT, ${key}, movetoworkspace, ${workspace}" + ] + ) + 10)); + + # Mouse + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod CTRL, mouse:272, resizewindow" + "$mod SHIFT, mouse:272, moveintogroup" + ]; + + # Ignore Locked State + bindl = [ + # Media Controls + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ", XF86AudioNext, exec, playerctl next" + + # Volume + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ]; + + # Repeat on Hold + bindle = [ + # Volume + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 5%-" + + # Backlight + ", XF86MonBrightnessUp, exec, brillo -u 300000 -A 5" + ", XF86MonBrightnessDown, exec, brillo -u 300000 -U 5" + ]; + }; +} diff --git a/modules/gui/desktop/hyprland/settings/rules.nix b/modules/gui/desktop/hyprland/settings/rules.nix @@ -0,0 +1,22 @@ +_: { + ## Window Rules + wayland.windowManager.hyprland.settings.windowrulev2 = [ + # PiP Window + "float, title:^(Picture-in-Picture)$" + "pin, title:^(Picture-in-Picture)$" + + # Throw away Sharing Window + "workspace special silent, title:^(Firefox — Sharing Indicator)$" + "workspace special silent, title:^(.*is sharing (your screen|a window)\.)$" + + # Idle Inhibit during media consumption + "idleinhibit focus, class:^(mpv|.+exe)$" + "idleinhibit focus, class:^(firefox|google-chrome)$, title:^(.*YouTube.*)$" + "idleinhibit fullscreen, class:^(firefox|google-chrome)$" + + # Prompt Windows + "dimaround, class:^(gcr-prompter)$" + "dimaround, class:^(xdg-desktop-portal-gtk)$" + "dimaround, class:^(polkit-gnome-authentication-agent-1)$" + ]; +} diff --git a/modules/gui/desktop/pantheon.nix b/modules/gui/desktop/pantheon.nix @@ -38,6 +38,7 @@ in { cursors = { name = "elementary"; package = pkgs.pantheon.elementary-icon-theme; + size = 32; }; launcher = { diff --git a/modules/gui/desktop/xfce/compositor.nix b/modules/gui/desktop/xfce/compositor.nix @@ -81,7 +81,7 @@ owner = "FT-Labs"; repo = "picom"; rev = "fe5b416ed6f43c31418d21dde7a9f20c12d7dfb0"; - sha256 = "sha256-KX+/nO/nJlUjsZwVg2/vQy+byYmtnKbtxuhyiq/tWg8="; + sha256 = "sha256-jouBx8fqoy/psD/P9dX3Q4/D4IWsLSxA210CKcBbh4I="; }; }); }; diff --git a/modules/gui/desktop/xfce/default.nix b/modules/gui/desktop/xfce/default.nix @@ -7,7 +7,7 @@ ... } @ args: with files; let - inherit (config.gui) desktop wallpaper; + inherit (config.gui) desktop fancy wallpaper; exists = app: builtins.elem app config.apps.list; inherit (lib) mkForce mkIf mkMerge; @@ -16,9 +16,6 @@ with files; let name = "Arc-Dark"; package = pkgs.arc-theme; }; - - # Window Composition - compositor = config.hardware.cpu.mode != "powersave"; in { ## XFCE Desktop Configuration ## config = mkIf (desktop == "xfce" || desktop == "xfce-minimal") (mkMerge [ @@ -51,7 +48,7 @@ in { } ## Full-Fledged XFCE Desktop Configuration - (mkIf (desktop == "xfce" && compositor) (import ./compositor.nix args)) + (mkIf (desktop == "xfce" && fancy) (import ./compositor.nix args)) (mkIf (desktop == "xfce") { # Desktop Components gui = { @@ -205,7 +202,7 @@ in { config.stylix.fonts.sansSerif.name config.stylix.fonts.monospace.name ( - if compositor + if fancy then "false" else "true" ) diff --git a/modules/gui/fonts.nix b/modules/gui/fonts.nix @@ -76,8 +76,6 @@ unifont fira - fira-code - fira-mono roboto roboto-slab source-code-pro diff --git a/modules/gui/launcher.nix b/modules/gui/launcher.nix @@ -79,8 +79,8 @@ in { Type = "Simple"; Restart = "Always"; RestartSec = 1; - ExecStart = pkgs.writeShellScript "ulauncher-env-wrapper.sh" '' - export PATH="''${XDG_BIN_HOME}:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" + ExecStart = pkgs.writeShellScript "ulauncher-wrapper.sh" '' + ${files.path.systemd} export GDK_BACKEND=${cfg.server} exec ${pkgs.ulauncher}/bin/ulauncher --hide-window ${ if cfg.shadow diff --git a/modules/gui/theme.nix b/modules/gui/theme.nix @@ -40,6 +40,12 @@ in { type = types.package; default = pkgs.bibata-cursors; }; + + size = mkOption { + description = "Cursors Size"; + type = types.int; + default = 28; + }; }; wallpaper = mkOption { @@ -59,7 +65,7 @@ in { { autoEnable = false; image = cfg.wallpaper; - cursor = cfg.cursors // {size = 28;}; + cursor = cfg.cursors; } // ( if (!enable) diff --git a/modules/gui/wayland.nix b/modules/gui/wayland.nix @@ -11,7 +11,9 @@ environment.sessionVariables = { NIXOS_OZONE_WL = "1"; MOZ_ENABLE_WAYLAND = "1"; - QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORM = "wayland;xcb"; + GDK_BACKEND = "wayland,x11"; + CLUTTER_BACKEND = "wayland"; }; # Programs Support diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix @@ -13,7 +13,11 @@ in { ## Z Shell Configuration ## config = lib.mkIf enable { # Shell Environment - programs.zsh.enable = true; + programs.zsh = { + enable = true; + enableCompletion = false; + }; + user.persist = { files = [".zsh_history"]; directories = [".cache/zsh"]; diff --git a/modules/user/default.nix b/modules/user/default.nix @@ -151,11 +151,11 @@ in { useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "bak"; + users = mapAttrs (_: value: {imports = value.homeConfig;}) settings; extraSpecialArgs = { inherit util inputs files; sys = config; }; - users = mapAttrs (_: value: {imports = value.homeConfig;}) settings; }; # Debug diff --git a/packages/firefox-elementary-theme/default.nix b/packages/firefox-elementary-theme/default.nix @@ -6,7 +6,7 @@ with pkgs; let metadata = import ./metadata.nix; in - stdenv.mkDerivation rec { + stdenv.mkDerivation { pname = "firefox-elementary-theme"; version = metadata.rev; diff --git a/shells/python.nix b/shells/python.nix @@ -1,13 +1,17 @@ pkgs: { name = "Python"; packages = with pkgs; - with python39Packages; [ - python39 + with python311Packages; [ + python3 pip autopep8 pylint + matplotlib + numpy + pandas + ipython poetry-core setuptools