dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 02ec6e9aca4d7e043882c9ea0a12564f3f2bbaae parent 89792988ead11680b206f25921e2a84e8439a0da Author: maydayv7 <maydayv7@gmail.com> Date: Thu, 22 Feb 2024 20:10:36 +0530 feat: Add `gui.display`
Diffstat:
| M | devices/futura.nix | | | 5 | ++++- |
| M | devices/vortex.nix | | | 1 | + |
| M | files/xfce/settings/xfce4-desktop.xml | | | 2 | +- |
| M | flake.lock | | | 8 | ++++---- |
| M | modules/README.md | | | 3 | ++- |
| M | modules/gui/default.nix | | | 6 | ++++++ |
| M | modules/gui/desktop/hyprland/README.md | | | 2 | +- |
| M | modules/gui/desktop/hyprland/apps/bar.nix | | | 8 | +++++--- |
| M | modules/gui/desktop/hyprland/settings/keybindings.nix | | | 2 | +- |
| M | modules/gui/desktop/xfce/default.nix | | | 6 | ++++-- |
10 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/devices/futura.nix b/devices/futura.nix @@ -16,8 +16,11 @@ modules = ["common-pc" "common-pc-laptop" "common-cpu-intel" "common-gpu-intel"]; }; - gui.desktop = "xfce"; apps.list = ["firefox" "office"]; + gui = { + desktop = "xfce"; + display = "eDP-1"; + }; # User Navya user = { diff --git a/devices/vortex.nix b/devices/vortex.nix @@ -42,6 +42,7 @@ gui = { desktop = "hyprland"; + display = "eDP-1"; wallpaper = "Thread"; fancy = true; }; diff --git a/files/xfce/settings/xfce4-desktop.xml b/files/xfce/settings/xfce4-desktop.xml @@ -3,7 +3,7 @@ <channel name="xfce4-desktop" version="1.0"> <property name="backdrop" type="empty"> <property name="screen0" type="empty"> - <property name="monitoreDP-1" type="empty"> + <property name="monitor@display" type="empty"> <property name="workspace0" type="empty"> <property name="color-style" type="int" value="0"/> <property name="image-style" type="int" value="4"/> diff --git a/flake.lock b/flake.lock @@ -506,11 +506,11 @@ }, "hardware": { "locked": { - "lastModified": 1708431491, - "narHash": "sha256-X5S/aZMyKYynpFNquXoSmaLt483skMuo2Y6W3o4OZWM=", - "owner": "maydayv7", + "lastModified": 1708594753, + "narHash": "sha256-c/gH7iXS/IYH9NrFOT+aJqTq+iEBkvAkpWuUHGU3+f0=", + "owner": "nixos", "repo": "nixos-hardware", - "rev": "8d8c40d27af343a14db027fc66cc6113b2945907", + "rev": "3f7d0bca003eac1a1a7f4659bbab9c8f8c2a0958", "type": "github" }, "original": { diff --git a/modules/README.md b/modules/README.md @@ -26,7 +26,8 @@ Configuration [Builder](./configuration.nix) - [`gui`](./gui): Module that configures GUI Desktops/Environments and the like - - - `desktop`: Choice of GUI Desktop - `"gnome" / "xfce" / "pantheon"` + - `desktop`: Choice of GUI Desktop - `"hyprland" / "gnome" / "xfce" / "pantheon"` + - `display`: Main GUI Display - Ex. `"HDMI-A-1"` - `wallpaper`: Desktop Wallpaper Choice (taken from `files.wallpapers`) - `fancy`: Enable Fancy GUI Effects - `true / false` - `fonts` - diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -14,6 +14,12 @@ in { options.gui = { fancy = mkEnableOption "Enable Fancy GUI Effects"; + display = mkOption { + description = "Main GUI Display"; + type = types.str; + default = ""; + example = "HDMI-A-1"; + }; desktop = mkOption { description = "GUI Desktop Choice"; type = types.enum ((name ./desktop) ++ map (x: x + "-iso") (import ./desktop/iso.nix) ++ [""]); diff --git a/modules/gui/desktop/hyprland/README.md b/modules/gui/desktop/hyprland/README.md @@ -39,7 +39,7 @@ | <kbd>$mod comma</kbd> | workspace | m-1 | Move to previous workspace | | <kbd>$mod period</kbd> | workspace | m+1 | Move to next workspace | | <kbd>$mod SHIFT grave</kbd> | movetoworkspace | special | Move window to special workspace | -| <kbd>$mod grave</kbd> | togglespecialworkspace | eDP-1 | Toggle special workspace on default display | +| <kbd>$mod grave</kbd> | togglespecialworkspace | config.gui.display | Toggle special workspace on default display | | <kbd>$mod SHIFT comma</kbd> | movetoworkspace | m-1 | Move window to previous workspace | | <kbd>$mod SHIFT period</kbd> | movetoworkspace | m+1 | Move window to next workspace | | <kbd>$mod ALT comma</kbd> | focusmonitor | l | Move focus to left monitor | diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -83,6 +83,7 @@ in rec { format = ""; tooltip = false; on-click = "nwg-drawer"; + on-click-right = "hyprctl dispatch hycov:toggleoverview"; }; user = { @@ -99,7 +100,7 @@ in rec { format = "{icon}"; on-scroll-up = "hyprctl dispatch workspace m+1"; on-scroll-down = "hyprctl dispatch workspace m-1"; - persistent-workspaces."eDP-1" = 3; + persistent-workspaces."${sys.gui.display}" = 3; format-icons = { default = ""; "1" = ""; @@ -112,6 +113,7 @@ in rec { "8" = ""; "9" = ""; "10" = ""; + OVERVIEW = ""; special = ""; }; }; @@ -207,8 +209,8 @@ in rec { 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"; + on-scroll-down = "brillo -u 300000 -A 5"; + on-scroll-up = "brillo -u 300000 -U 5"; on-click = "nwg-displays"; }; diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -62,7 +62,7 @@ in { # Special Workspace "$mod SHIFT, grave, movetoworkspace, special" - "$mod, grave, togglespecialworkspace, eDP-1" + "$mod, grave, togglespecialworkspace, ${sys.gui.display}" # Move Window to Workspace "$mod SHIFT, comma, movetoworkspace, m-1" 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 fancy wallpaper; + inherit (config.gui) desktop display fancy icons wallpaper; exists = app: builtins.elem app config.apps.list; inherit (lib) hasPrefix mkIf mkMerge; @@ -188,6 +188,7 @@ in { replace = { placeholders = [ "@system" + "@monitor" "@wallpaper" "@theme" "@icons" @@ -198,9 +199,10 @@ in { ]; values = [ path.system + display wallpaper theme.name - config.gui.icons.name + icons.name config.stylix.cursor.name config.stylix.fonts.sansSerif.name config.stylix.fonts.monospace.name