aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/window-manager/sxhkd/keybindings
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-25 19:41:02 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-25 19:41:02 +0530
commit478081af928e1557b325f4a4cbd5b67f079660d2 (patch)
treec7975b403c29acfd4de91664320e7ebbd0ac1685 /modules/desktop/window-manager/sxhkd/keybindings
parent165cde749fc899d4c86eb6de97d3b7c4373eb7b3 (diff)
downloadhome-manager-config-478081af928e1557b325f4a4cbd5b67f079660d2.tar.gz
home-manager-config-478081af928e1557b325f4a4cbd5b67f079660d2.zip
Adding nnn file manager.
Adding bspwm bindings to sxhkd only if the module is enabled.
Diffstat (limited to 'modules/desktop/window-manager/sxhkd/keybindings')
-rw-r--r--modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix b/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix
new file mode 100644
index 0000000..1d66d16
--- /dev/null
+++ b/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix
@@ -0,0 +1,45 @@
+{ createKeybinding, pkgs }:
+
+let
+ bspc = "${pkgs.bspwm}/bin/bspc";
+in {
+ ${(createKeybinding
+ "q"
+ "Kill current window.")}
+ = "${bspc} node -c";
+
+ ${(createKeybinding
+ "{1-9,0}"
+ "Switch workspace.")}
+ = "${bspc} desktop -f {1-9,10}";
+
+ ${(createKeybinding
+ "shift + {1-9,0}"
+ "Move window to workspace.")}
+ = "${bspc} node -d {1-9,10} --follow";
+
+ ${(createKeybinding
+ "{n,d,m}"
+ "Set current window mode (tiled, floating, fullscreen).")}
+ = "${bspc} node focused -t {tiled,floating,fullscreen}";
+
+ ${(createKeybinding
+ "{_,shift + }{h,j,k,l}"
+ "Navigate between windows.")}
+ = "${bspc} node --{focus,swap} {west,south,north,east}";
+
+ # the indentation for each line is required to work with the help prompt
+ ${(createKeybinding
+ "ctrl + {h,j,k,l}"
+ "Resize current window.")}
+ = ''
+ ${bspc} node {@parent/second -z left -20 0; \
+ @parent/first -z right -20 0, \
+ @parent/second -z top 0 +20; \
+ @parent/first -z bottom 0 +20, \
+ @parent/first -z bottom 0 -20; \
+ @parent/second -z top 0 -20, \
+ @parent/first -z right +20 0; \
+ @parent/second -z left +20 0}
+'';
+}