summaryrefslogtreecommitdiff
path: root/home/desktops/hyprland/binds.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/desktops/hyprland/binds.nix')
-rw-r--r--home/desktops/hyprland/binds.nix139
1 files changed, 139 insertions, 0 deletions
diff --git a/home/desktops/hyprland/binds.nix b/home/desktops/hyprland/binds.nix
new file mode 100644
index 0000000..94e0f39
--- /dev/null
+++ b/home/desktops/hyprland/binds.nix
@@ -0,0 +1,139 @@
+{config, ...}: {
+ wayland.windowManager.hyprland.settings = {
+ # Keybinds
+ "$mod" = "SUPER";
+ bind = [
+ # Launch programs
+
+ "$mod, W, exec, ${config.default.browser}"
+ "$mod, D, exec, ${config.default.appLauncher}"
+ "$mod, L, exec, ${config.default.lockScreen}"
+ "$mod, Return, exec, ${config.default.terminal}"
+ ", Print, exec, grimblast copy area"
+
+ # Misc
+
+ "$mod SHIFT, L, exit"
+ "$mod, tab, hyprexpo:expo, toggle"
+
+ # Window operations
+
+ "$mod SHIFT, Q, killactive"
+ "$mod SHIFT, SPACE, togglefloating"
+ "$mod, F, fullscreen"
+ "$mod, J, togglesplit"
+
+ # Move focus with mod + arrow keys
+
+ "$mod, left, movefocus, l"
+ "$mod, right, movefocus, r"
+ "$mod, up, movefocus, u"
+ "$mod, down, movefocus, d"
+
+ # Move window across workspace with mod + arrow keys
+
+ "$mod SHIFT, left, hy3:movewindow, l"
+ "$mod SHIFT, right, hy3:movewindow, r"
+ "$mod SHIFT, up, hy3:movewindow, u"
+ "$mod SHIFT, down, hy3:movewindow, d"
+
+ # Switch workspaces with mod + [0-9]
+
+ "$mod, 1, workspace, 1"
+ "$mod, 2, workspace, 2"
+ "$mod, 3, workspace, 3"
+ "$mod, 4, workspace, 4"
+ "$mod, 5, workspace, 5"
+ "$mod, 6, workspace, 6"
+ "$mod, 7, workspace, 7"
+ "$mod, 8, workspace, 8"
+ "$mod, 9, workspace, 9"
+
+ # Move active window to a workspace with mod + SHIFT + [0-9]
+
+ "$mod SHIFT, 1, movetoworkspacesilent, 1"
+ "$mod SHIFT, 2, movetoworkspacesilent, 2"
+ "$mod SHIFT, 3, movetoworkspacesilent, 3"
+ "$mod SHIFT, 4, movetoworkspacesilent, 4"
+ "$mod SHIFT, 5, movetoworkspacesilent, 5"
+ "$mod SHIFT, 6, movetoworkspacesilent, 6"
+ "$mod SHIFT, 7, movetoworkspacesilent, 7"
+ "$mod SHIFT, 8, movetoworkspacesilent, 8"
+ "$mod SHIFT, 9, movetoworkspacesilent, 9"
+ "$mod SHIFT, 0, movetoworkspacesilent, 10"
+
+ # Move to tab
+
+ "LALT, 1, hy3:focustab, index, 01"
+ "LALT, 2, hy3:focustab, index, 02"
+ "LALT, 3, hy3:focustab, index, 03"
+ "LALT, 4, hy3:focustab, index, 04"
+ "LALT, 5, hy3:focustab, index, 05"
+ "LALT, 6, hy3:focustab, index, 06"
+ "LALT, 7, hy3:focustab, index, 07"
+ "LALT, 8, hy3:focustab, index, 08"
+ "LALT, 9, hy3:focustab, index, 09"
+ "LALT, 0, hy3:focustab, index, 10"
+
+ "$mod SHIFT, B, hy3:makegroup, h"
+ "$mod SHIFT, V, hy3:makegroup, v"
+ "$mod SHIFT, C, hy3:changegroup, toggletab"
+
+ # Scroll through existing workspaces with mod + scroll
+
+ "$mod, mouse_down, workspace, e+1"
+ "$mod, mouse_up, workspace, e-1"
+ ];
+
+ bindn = [
+ # Focus windows with scroll wheel or middle click
+
+ ", mouse:272, hy3:focustab, mouse"
+ ", mouse_down, hy3:focustab, l, require_hovered"
+ ", mouse_up, hy3:focustab, r, require_hovered"
+ ];
+
+ bindm = [
+ # Move/resize windows with mod + LMB/RMB and dragging
+
+ "$mod, mouse:272, movewindow"
+ "$mod, mouse:273, resizewindow"
+ ];
+
+ binde = [
+ # Audio
+
+ # raise volume
+ ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
+ # lower volume
+ ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
+ # mute speaker
+ ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
+ # mute mic
+ ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
+
+ # Media
+
+ # play
+ ", XF86AudioPlay, exec, playerctl play-pause"
+ # next
+ ", XF86AudioNext, exec, playerctl next"
+ # prev
+ ", XF86AudioPrev, exec, playerctl previous"
+
+ # Backlight
+
+ ", XF86MonBrightnessDown, exec, brightnessctl set 5%-"
+ ", XF86MonBrightnessUp, exec, brightnessctl set 5%+"
+ ];
+
+ bindl = let
+ monitor = builtins.elemAt config.monitors 0;
+ cfg = "highres, auto, ${toString monitor.scale}, bitdepth, ${toString monitor.bitdepth}";
+ in [
+ # Laptops when docked
+ ", switch:on:Lid, exec, hyprctl keyword monitor \"${monitor.name}, disable\""
+ ", switch:off:Lid, exec, hyprctl keyword monitor \"${monitor.name}, ${cfg}\""
+ ];
+ };
+}