dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 2c179f3112a3eea3f4580b7607f6e64571f3f51e parent 2a7fba7e36ac58f42bc3c7d28fd774ab79e8a77a Author: maydayv7 <maydayv7@gmail.com> Date: Mon, 22 Apr 2024 22:13:51 +0530 feat: Hyprland QOL Fixes + Add Window Minimization Submap + Fix GTK `prefers-dark` + Fix System Suspend
Diffstat:
24 files changed, 200 insertions(+), 138 deletions(-)
diff --git a/README.md b/README.md @@ -504,6 +504,7 @@ You can navigate to the `README`s present in the various directories to know mor - Update to latest version - Desktop Icons - Keybindings List + - Useful Submaps - Panel Improvements - Border Gradients - Revamp `hyprutils` Script diff --git a/files/_archive/.keep b/files/archive/.keep diff --git a/files/_archive/Linux/Arch/COMMANDS.md b/files/archive/Linux/Arch/COMMANDS.md diff --git a/files/_archive/Linux/Arch/INSTALL.md b/files/archive/Linux/Arch/INSTALL.md diff --git a/files/_archive/Linux/Arch/zshrc b/files/archive/Linux/Arch/zshrc diff --git a/files/_archive/Linux/Pop/conky/conky.lua b/files/archive/Linux/Pop/conky/conky.lua diff --git a/files/_archive/Linux/Pop/conky/conkyrc b/files/archive/Linux/Pop/conky/conkyrc diff --git a/files/_archive/Linux/Pop/neofetch/config.conf b/files/archive/Linux/Pop/neofetch/config.conf diff --git a/files/_archive/Linux/Pop/p10k.zsh b/files/archive/Linux/Pop/p10k.zsh diff --git a/files/_archive/Windows/APPS.md b/files/archive/Windows/APPS.md diff --git a/files/_archive/Windows/Velociraptor.rmskin b/files/archive/Windows/Velociraptor.rmskin Binary files differ. diff --git a/files/gnome/settings/default.nix b/files/gnome/settings/default.nix @@ -128,7 +128,6 @@ in { }; "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; clock-show-weekday = true; enable-animations = true; enable-hot-corners = true; diff --git a/files/hyprland/pypr.toml b/files/hyprland/pypr.toml @@ -1,7 +1,6 @@ [pyprland] plugins = [ "scratchpads", - "magnify", "toggle_special" ] diff --git a/files/hyprland/waybar.css b/files/hyprland/waybar.css @@ -42,6 +42,10 @@ window#waybar { background-color: transparent; } +#custom-minimized { + color: @base0E; +} + #taskbar button.active { background: @base03; } @@ -121,6 +125,7 @@ window#waybar { #custom-dropdown, #custom-dunst, #custom-logo, +#custom-minimized, #custom-power, #custom-weather, #keyboard-state, diff --git a/files/pantheon/dconf.nix b/files/pantheon/dconf.nix @@ -28,7 +28,6 @@ in { "org/gnome/desktop/interface" = { clock-format = "24h"; clock-show-weekday = true; - color-scheme = "prefer-dark"; cursor-size = 32; document-font-name = "${head fonts.sansSerif} 12"; enable-animations = true; diff --git a/flake.lock b/flake.lock @@ -470,11 +470,11 @@ ] }, "locked": { - "lastModified": 1713447438, - "narHash": "sha256-6WgXIc5h8DTbLzdKrkGmJusCZfaNeT/XK+EX3wqQ5LI=", + "lastModified": 1713576964, + "narHash": "sha256-qn/SED9lGPRkbgjbAm0Q8TG8Eo9PldAcLAVwZXsKVJs=", "owner": "DreamMaoMao", "repo": "hycov", - "rev": "2c25830474ed41058accf87568991d3444b16537", + "rev": "df22a0cafc4ea1d2074231f5d1c906d819b1d660", "type": "github" }, "original": { @@ -621,11 +621,11 @@ ] }, "locked": { - "lastModified": 1713480110, - "narHash": "sha256-AUGdqvZs3C2wJziAzbxccXMvXW+4/41TAuyRE0IG8Yc=", + "lastModified": 1713738762, + "narHash": "sha256-wXMqOQosjblsdV3x0DzpH7qSBUs5hT5Ca6eZ2Xp8TOA=", "owner": "KZDKM", "repo": "Hyprspace", - "rev": "fc8d5f4152e4a935838b25e9f4da0fc5e958baba", + "rev": "de3b1ccbf30498b6fcd42b36418e33a2c8c1405a", "type": "github" }, "original": { diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -52,7 +52,7 @@ in rec { margin-bottom = 5; margin-left = 5; - modules-left = ["custom/logo" "group/users" "hyprland/workspaces" "hyprland/window"]; + modules-left = ["custom/logo" "group/users" "hyprland/workspaces" "group/window"]; modules-center = ["wlr/taskbar"]; modules-right = [ "group/menu" @@ -116,6 +116,12 @@ in rec { }; }; + "group/window" = { + orientation = "horizontal"; + modules = ["hyprland/window" "custom/minimized"]; + drawer.transition-left-to-right = true; + }; + "hyprland/window" = { format = "{initialTitle}"; max-length = 40; @@ -132,6 +138,27 @@ in rec { }; }; + "custom/minimized" = { + format = ""; + tooltip = "false"; + on-click = with pkgs; "${writeShellApplication { + name = "minimize"; + runtimeInputs = [hyprworld.hyprland]; + text = '' + if hyprctl workspaces | grep "special:minimized" + then + hyprctl --batch "\ + dispatch submap reset;\ + dispatch workspace special:minimized;\ + dispatch submap minimized" + exit + else + hyprctl notify 3 2000 0 "No minimized windows present" + fi + ''; + }}/bin/minimize"; + }; + "wlr/taskbar" = { format = "{icon}"; icon-size = 16; diff --git a/modules/gui/desktop/hyprland/apps/security.nix b/modules/gui/desktop/hyprland/apps/security.nix @@ -29,18 +29,21 @@ in { useImage = true; }; - # Screen Idle + # Idle Daemon services.swayidle = { enable = true; systemdTarget = "hyprland-session.target"; - events = [ + events = let + toggle = "${getExe pkgs.custom.hyprutils} toggle media"; + lock = flag: "sh -c '${toggle}; ${getExe locker} ${flag}; ${toggle}'"; + in [ { event = "before-sleep"; - command = "${pkgs.systemd}/bin/loginctl lock-session"; + command = lock "--grace 0"; } { event = "lock"; - command = let toggle = "${getExe pkgs.custom.hyprutils} toggle media"; in "sh -c '${toggle}; ${getExe locker}; ${toggle}'"; + command = lock ""; } ]; timeouts = [ @@ -83,7 +86,7 @@ in { # Authorization Agent systemd.user.services.polkit = { - Unit.Description = "polkit-gnome-authentication-agent-1"; + Unit.Description = "Polkit Authentication (GNOME)"; Install = { WantedBy = ["graphical-session.target"]; diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -47,7 +47,7 @@ in { binds = { workspace_center_on = 1; movefocus_cycles_fullscreen = true; - workspace_back_and_forth = true; + workspace_back_and_forth = false; }; gestures = { diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -1,119 +1,147 @@ {sys, ...}: { - ## Compositor Keybindings - wayland.windowManager.hyprland.settings = { - "$mod" = "SUPER"; - bind = - [ - # Compositor Commands - "$mod, Q, killactive," - "$mod, P, pin" - "$mod, M, fullscreen, 1" - "$mod SHIFT, M, fullscreen," - "$mod, Space, togglesplit" - "$mod SHIFT, D, exec, hyprutils toggle monitor ${sys.gui.display}" - - # Window Focus - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - "ALT CTRL, Tab, focusurgentorlast" - "ALT CTRL, Tab, bringactivetotop," - - # Window Swap - "$mod SHIFT, left, swapwindow, l" - "$mod SHIFT, right, swapwindow, r" - "$mod SHIFT, up, swapwindow, u" - "$mod SHIFT, down, swapwindow, d" - - # Window Groups - "$mod SHIFT, space, togglegroup" - "ALT, grave, changegroupactive, f" - "ALT SHIFT, grave, changegroupactive, b" - - # Floating Mode - "$mod, semicolon, togglefloating," - "$mod, apostrophe, exec, hyprutils toggle float" - "$mod, C, centerwindow" - - # Window Minimization - "ALT, Q, movetoworkspacesilent, special:minimized" - "ALT SHIFT, Q, togglespecialworkspace, minimized" - "ALT SHIFT, Q, movetoworkspace, +0" - - # Cycle Workspaces - "$mod, comma, split:workspace, m-1" - "$mod, period, split:workspace, m+1" - - # Special Workspace - "$mod, grave, togglespecialworkspace, stash" - "$mod SHIFT, grave, exec, pypr toggle_special stash" - - # Move Window to Workspace - "$mod SHIFT, comma, split:movetoworkspace, r-1" - "$mod SHIFT, period, split:movetoworkspace, r+1" - - # Cycle Monitors - "$mod ALT, comma, focusmonitor, l" - "$mod ALT, period, focusmonitor, r" - - # Move Window to Monitor - "$mod SHIFT ALT, comma, movewindow, mon:-1" - "$mod SHIFT ALT, period, movewindow, mon:+1" - - # 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" - ] - ++ - # Workspaces - (with builtins; - concatLists (genList ( - n: let - num = toString (n + 1); - in [ - "$mod, ${num}, split:workspace, ${num}" - "$mod SHIFT, ${num}, split:movetoworkspace, ${num}" - ] - ) - 9)); - - # 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, hyprutils media toggle" - ", XF86AudioPrev, exec, hyprutils media previous" - ", XF86AudioNext, exec, hyprutils media next" - - # Volume - ", XF86AudioMute, exec, hyprutils volume mute" - ]; - - # Repeat on Hold - bindle = [ - # Volume - ", XF86AudioRaiseVolume, exec, hyprutils volume up" - ", XF86AudioLowerVolume, exec, hyprutils volume down" - - # Backlight - ", XF86MonBrightnessUp, exec, hyprutils brightness up" - ", XF86MonBrightnessDown, exec, hyprutils brightness down" - - # Magnifier - "$mod, equal, exec, hyprutils zoom in" - "$mod, minus, exec, hyprutils zoom out" - ]; + ## Compositor Binds ## + wayland.windowManager.hyprland = { + ## Keybindings + settings = { + "$mod" = "SUPER"; + bind = + [ + # Compositor Commands + "$mod, Q, killactive," + "ALT, F4, killactive," + "$mod, P, pin" + "$mod, M, fullscreen, 1" + "$mod SHIFT, M, fullscreen," + "$mod, Space, togglesplit" + "$mod SHIFT, D, exec, hyprutils toggle monitor ${sys.gui.display}" + + # Window Focus + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "ALT CTRL, Tab, focusurgentorlast" + "ALT CTRL, Tab, bringactivetotop," + + # Window Swap + "$mod SHIFT, left, swapwindow, l" + "$mod SHIFT, right, swapwindow, r" + "$mod SHIFT, up, swapwindow, u" + "$mod SHIFT, down, swapwindow, d" + + # Window Groups + "$mod SHIFT, space, togglegroup" + "ALT, grave, changegroupactive, f" + "ALT SHIFT, grave, changegroupactive, b" + + # Floating Mode + "$mod, semicolon, togglefloating," + "$mod, apostrophe, exec, hyprutils toggle float" + "$mod, C, centerwindow" + + # Window Minimization + "ALT, Q, movetoworkspacesilent, special:minimized" + "ALT SHIFT, Q, togglespecialworkspace, minimized" + + # Cycle Workspaces + "$mod, comma, split:workspace, m-1" + "$mod, period, split:workspace, m+1" + + # Special Workspace + "$mod, grave, togglespecialworkspace, stash" + "$mod SHIFT, grave, exec, pypr toggle_special stash" + + # Move Window to Workspace + "$mod SHIFT, comma, split:movetoworkspace, r-1" + "$mod SHIFT, period, split:movetoworkspace, r+1" + + # Cycle Monitors + "$mod ALT, comma, focusmonitor, l" + "$mod ALT, period, focusmonitor, r" + + # Move Window to Monitor + "$mod SHIFT ALT, comma, movewindow, mon:-1" + "$mod SHIFT ALT, period, movewindow, mon:+1" + + # 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" + ] + ++ + # Workspaces + (with builtins; + concatLists (genList ( + n: let + num = toString (n + 1); + in [ + "$mod, ${num}, split:workspace, ${num}" + "$mod SHIFT, ${num}, split:movetoworkspace, ${num}" + ] + ) + 9)); + + # 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, hyprutils media toggle" + ", XF86AudioPrev, exec, hyprutils media previous" + ", XF86AudioNext, exec, hyprutils media next" + + # Volume + ", XF86AudioMute, exec, hyprutils volume mute" + ]; + + # Repeat on Hold + bindle = [ + # Volume + ", XF86AudioRaiseVolume, exec, hyprutils volume up" + ", XF86AudioLowerVolume, exec, hyprutils volume down" + + # Backlight + ", XF86MonBrightnessUp, exec, hyprutils brightness up" + ", XF86MonBrightnessDown, exec, hyprutils brightness down" + + # Magnifier + "$mod, equal, exec, hyprutils zoom in" + "$mod, minus, exec, hyprutils zoom out" + ]; + }; + + ## Submaps + extraConfig = '' + # Window Minimization + bind = ALT SHIFT, Q, submap, minimized + submap = minimized + bind = , F4, killactive + bind = , Return, movetoworkspace, +0 + bind = , Return, submap, reset + bind = , mouse:272, movetoworkspace, +0 + bind = , mouse:272, submap, reset + bind = , escape, togglespecialworkspace, minimized + bind = , escape, submap, reset + submap = reset + + # Window Resize + bind = ALT, R, submap, resize + submap = resize + binde = , right, resizeactive, 10 0 + binde = , left, resizeactive, -10 0 + binde = , up, resizeactive, 0 -10 + binde = , down, resizeactive, 0 10 + bind = , escape, submap, reset + submap = reset + ''; }; } diff --git a/modules/gui/desktop/hyprland/settings/plugins.nix b/modules/gui/desktop/hyprland/settings/plugins.nix @@ -4,9 +4,7 @@ pkgs, files, ... -}: let - inherit (sys.lib.stylix.colors) base00 base0D; -in { +}: { ## Plugin Settings # Pyprland home = { @@ -16,7 +14,7 @@ in { wayland.windowManager.hyprland = { plugins = with pkgs.hyprworld; [hycov hyprexpo Hyprspace hyprsplit]; - extraConfig = let + extraConfig = with sys.lib.stylix.colors; let gaps = builtins.toString config.wayland.windowManager.hyprland.settings.general.gaps_in; @@ -58,6 +56,8 @@ in { overrideGaps = true gapsIn = ${gaps} gapsOut = ${gaps} + panelBorderWidth = 1 + panelBorderColor = rgb(${base0A}) workspaceActiveBorder = rgb(${base0D}) } diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix @@ -49,6 +49,7 @@ in { home.file.".config/gtk-3.0/bookmarks".text = files.gtk.bookmarks; # Theming + dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; gtk = { enable = true; inherit (cfg) theme; diff --git a/packages/overlays/chrome.nix b/packages/overlays/chrome.nix @@ -4,7 +4,7 @@ final: prev: { installPhase = old.installPhase + '' - fix=" --enable-features=WebUIDarkMode,TouchpadOverscrollHistoryNavigation --force-dark-mode" + fix=" --enable-features=TouchpadOverscrollHistoryNavigation --gtk-version=4" substituteInPlace $out/share/applications/google-chrome.desktop \ --replace $exe "$exe$fix" ''; diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -35,7 +35,7 @@ in } (pkgs.writeShellApplication { name = "hyprutils"; runtimeInputs = with pkgs; [ - hyprland + hyprworld.hyprland coreutils dunst gnugrep