dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 9528320dbc20eece0379db80ed5535324993bbdc parent 6e58cb47a891ec06dea46bd1c9d3870dc7eac24c Author: maydayv7 <maydayv7@gmail.com> Date: Sat, 18 May 2024 16:08:46 +0530 feat: Hyprland QOL Fixes + Add Panel toggle + Add window invert plugin
Diffstat:
| M | files/hyprland/binds.pango | | | 4 | ++-- |
| M | flake.lock | | | 37 | +++++++++++++++++++++++++++++++++++++ |
| M | flake.nix | | | 5 | +++++ |
| M | modules/gui/desktop/hyprland/apps/default.nix | | | 33 | ++++++++++++++++++++++++--------- |
| M | modules/gui/desktop/hyprland/settings/plugins.nix | | | 3 | ++- |
| M | packages/flake.nix | | | 1 | + |
| M | scripts/hyprutils.nix | | | 15 | ++++++++++++++- |
7 files changed, 85 insertions(+), 13 deletions(-)
diff --git a/files/hyprland/binds.pango b/files/hyprland/binds.pango @@ -34,10 +34,10 @@ <tt>SHIFT Print</tt> Take Screenshot of screen <tt>$mod =<i> or </i>-</tt> Zoom in/out <tt>$mod L<i> or </i>Esc</tt> Lock screen / System Logoff -<tt>$mod S</tt> Toggle Compositor Shader +<tt>$mod [SHIFT] S</tt> Toggle Compositor Shader [Invert window] <tt>$mod ?</tt> Show this page -<tt>$mod A</tt> Application Drawer +<tt>$mod [SHIFT] A</tt> Application Drawer [Toggle top Panel] <tt>$mod SHIFT C</tt> Color Picker <tt>$mod [SHIFT] D</tt> Monitor Configuration [Toggle main Display] <tt>$mod F</tt> File Manager diff --git a/flake.lock b/flake.lock @@ -512,6 +512,27 @@ "type": "github" } }, + "hyprdark": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1713251571, + "narHash": "sha256-8sVbc/1VIw3K2I5XD7YwbjZ813UPNE1A+LNxu5pAWBc=", + "owner": "micha4w", + "repo": "Hypr-DarkWindow", + "rev": "e847f179adf4eab3517623e3d5209f531435a61a", + "type": "github" + }, + "original": { + "owner": "micha4w", + "repo": "Hypr-DarkWindow", + "type": "github" + } + }, "hyprland": { "inputs": { "hyprcursor": "hyprcursor", @@ -689,6 +710,21 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1705332318, + "narHash": "sha256-kcw1yFeJe9N4PjQji9ZeX47jg0p9A0DuU4djKvg1a7I=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "3449dc925982ad46246cfc36469baf66e1b64f17", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1708751719, @@ -817,6 +853,7 @@ "hardware": "hardware", "home-manager": "home-manager", "hycov": "hycov", + "hyprdark": "hyprdark", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", "hyprspace": "hyprspace", diff --git a/flake.nix b/flake.nix @@ -157,6 +157,11 @@ inputs.hyprland.follows = "hyprland"; }; + hyprdark = { + url = "github:micha4w/Hypr-DarkWindow"; + inputs.hyprland.follows = "hyprland"; + }; + hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -44,7 +44,6 @@ in { lollypop mission-center unstable.nwg-displays - custom.nwg-dock unstable.nwg-drawer nwg-wrapper unstable.overskride @@ -117,17 +116,18 @@ in { "$mod SHIFT, slash, exec, pkill -f -1 nwg-wrapper" # Binds List "$mod, slash, exec, ulauncher-toggle" "$mod, A, exec, nwg-drawer" + "$mod SHIFT, A, exec, hyprutils toggle panel" "$mod SHIFT, C, exec, hyprpicker -arf hex" "$mod, D, exec, pypr toggle displays" "$mod, F, exec, thunar" "$mod, N, exec, dunstctl history-pop" "$mod, T, exec, kitty" "$mod SHIFT, T, exec, pypr toggle term" - "$mod, V, exec, pypr toggle clip" + ''$mod, V, exec, sh -c "if ! hyprctl clients | grep 'class: clipse'; then pypr show clip; fi"'' "$mod, W, exec, firefox" "$mod, Return, exec, missioncenter" ", XF86Calculator, exec, qalculate-gtk" - "$mod, Escape, exec, wlogout -p layer-shell" + "$mod, Escape, exec, sh -c 'if ! pgrep -x wlogout; then wlogout -p layer-shell; fi'" ]; # Autostart @@ -137,23 +137,38 @@ in { # Clipboard "clipse -listen" - # Application Drawer - "nwg-drawer -r" - # Desktop Icons "dicons" + # Application Drawer + "nwg-drawer -r" + # Binds List (with files.hyprland; "nwg-wrapper -t ${binds} -c ${builtins.toFile "css" nwg.wrapper} -il 3 -sv 1") - - # Application Dock - "nwg-dock-hyprland -l 'overlay' -p 'top' -i 34 -w 9 -c 'hyprutils toggle minimized'" ]; # Utilities services.playerctld.enable = true; services.poweralertd.enable = true; + # Application Dock + systemd.user.services.nwg-dock = { + Unit.Description = "Application Dock"; + + Install = { + WantedBy = ["graphical-session.target"]; + Wants = ["graphical-session.target"]; + After = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${getExe pkgs.custom.nwg-dock} -l 'overlay' -p 'top' -i 30 -w 9 -c 'hyprutils toggle minimized'"; + Restart = "on-failure"; + RestartSec = 1; + }; + }; + # Terminal programs.kitty = { enable = true; diff --git a/modules/gui/desktop/hyprland/settings/plugins.nix b/modules/gui/desktop/hyprland/settings/plugins.nix @@ -19,7 +19,7 @@ }; wayland.windowManager.hyprland = { - plugins = with pkgs.hyprworld; [hycov hyprexpo Hyprspace hyprsplit]; + plugins = with pkgs.hyprworld; [hycov hyprexpo Hypr-DarkWindow Hyprspace hyprsplit]; extraConfig = with sys.lib.stylix.colors; let gaps = builtins.toString @@ -83,6 +83,7 @@ # Compositor Shaders "$mod, S, exec, hyprutils toggle shader" + "$mod SHIFT, S, invertactivewindow" # Application Overview "ALT, Tab, hycov:toggleoverview" diff --git a/packages/flake.nix b/packages/flake.nix @@ -41,6 +41,7 @@ in { hyprland.packages."${system}" // hyprland-plugins.packages."${system}" // hycov.packages."${system}" + // hyprdark.packages."${system}" // hyprspace.packages."${system}" // hyprsplit.packages."${system}"; }) diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -23,6 +23,7 @@ media - Persist and toggle audio playing state minimized - Show Minimized windows monitor - Toggle specified Monitor + panel - Toggle top Panel shader - Toggle Compositor Shader ''; in @@ -37,11 +38,13 @@ in } (pkgs.writeShellApplication { name = "hyprutils"; runtimeInputs = with pkgs; [ + custom.nwg-dock dunst gnome.zenity hyprshade hyprworld.hyprland swayidle + waybar alsa-utils brillo @@ -227,7 +230,7 @@ in ;; "float") WORKSPACE=$(hyprctl activeworkspace | grep "workspace ID" | awk '{print $3}') - hyprctl notify 1 2000 0 "Toggle window floating on Workspace $WORKSPACE" + hyprctl notify 1 2000 0 "Toggled window floating on Workspace $WORKSPACE" hyprctl dispatch workspaceopt allfloat ;; "idle") @@ -274,6 +277,16 @@ in hyprctl keyword monitor "$3, preferred, auto, 1" fi ;; + "panel") + if systemctl --user is-active waybar + then + systemctl --user stop waybar + systemctl --user stop nwg-dock + else + systemctl --user start waybar + systemctl --user start nwg-dock + fi + ;; "shader") hyprshade off mapfile SHADERS < <(hyprshade ls)