From 3d97f9b5d7608c171fb3cb58e12581000eff7c99 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Tue, 24 Dec 2024 13:56:54 +0100 Subject: [PATCH] refactor hyprland configuration and add grimblast screenshot tool; improve key bindings for better usability --- bin/actions/auto-start.sh | 2 +- .../packages/workstation/packages.nix | 1 + config/hyprland.conf | 51 ++++++++++--------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/bin/actions/auto-start.sh b/bin/actions/auto-start.sh index 16cf3ba..ecbdd4e 100755 --- a/bin/actions/auto-start.sh +++ b/bin/actions/auto-start.sh @@ -34,4 +34,4 @@ for app in "${apps[@]}"; do screen -dmS $app_name $app_name $app_params sleep 1 fi -done \ No newline at end of file +done diff --git a/config/home-manager/packages/workstation/packages.nix b/config/home-manager/packages/workstation/packages.nix index 91c987b..ff79e29 100644 --- a/config/home-manager/packages/workstation/packages.nix +++ b/config/home-manager/packages/workstation/packages.nix @@ -21,6 +21,7 @@ kitty-themes # Kitty terminal themes pavucontrol # PulseAudio volume control qrencode # qr code generator + grimblast # Screenshot tool ## Chat Apps telegram-desktop diff --git a/config/hyprland.conf b/config/hyprland.conf index a55571a..ac54ac4 100644 --- a/config/hyprland.conf +++ b/config/hyprland.conf @@ -170,7 +170,7 @@ input { kb_rules = # 0 = no, 1 = yes, 2 = on click - follow_mouse = 2 + follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. touchpad { @@ -196,20 +196,25 @@ device { ################### # See https://wiki.hyprland.org/Configuring/Keywords/ -$mainMod = SUPER # Sets "Windows" key as main modifier +$mainMod = SUPER +$superMod = SUPER +$shiftMod = SHIFT +$altMod = ALT +$ctrlMod = CTRL +$spaceMod = SPACE # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = CTRL ALT, T, exec, $terminal -bind = CTRL ALT, SPACE, exec, 1password --quick-access +bind = $ctrlMod $altMod, T, exec, $terminal +bind = $ctrlMod $altMod, SPACE, exec, 1password --quick-access bind = $mainMod, L, exec, hyprlock bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, $fileManager bind = $mainMod, V, togglefloating, -bind = CTRL, SPACE, exec, ulauncher-toggle +bind = $ctrlMod, SPACE, exec, ulauncher-toggle bind = $mainMod, R, exec, $menu -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, J, togglesplit, dwindle +bind = $altMod $shiftMod, 4, exec, grimblast --cursor copy area # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l @@ -229,21 +234,21 @@ bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 +# Move active window to a workspace with mainMod + $shiftMod + [0-9] +bind = $mainMod $shiftMod, 1, movetoworkspace, 1 +bind = $mainMod $shiftMod, 2, movetoworkspace, 2 +bind = $mainMod $shiftMod, 3, movetoworkspace, 3 +bind = $mainMod $shiftMod, 4, movetoworkspace, 4 +bind = $mainMod $shiftMod, 5, movetoworkspace, 5 +bind = $mainMod $shiftMod, 6, movetoworkspace, 6 +bind = $mainMod $shiftMod, 7, movetoworkspace, 7 +bind = $mainMod $shiftMod, 8, movetoworkspace, 8 +bind = $mainMod $shiftMod, 9, movetoworkspace, 9 +bind = $mainMod $shiftMod, 0, movetoworkspace, 10 # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic -bind = $mainMod SHIFT, S, movetoworkspace, special:magic +bind = $mainMod $shiftMod, S, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 @@ -274,11 +279,9 @@ bindl = , XF86AudioPrev, exec, playerctl previous # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules -# Example windowrule v1 -# windowrule = float, ^(kitty)$ - -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# Keep Ulauncher and 1Password focused since they both use a sort of quick-access window +windowrule = stayfocused,^(Ulauncher)$ +windowrule = stayfocused,^(1Password)$ # Ignore maximize requests from apps. You'll probably like this. windowrulev2 = suppressevent maximize, class:.*