aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/sxhkd
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@proton.me>2026-03-09 20:26:17 +0530
committerArpit Chakladar <arpitchakladar@proton.me>2026-03-09 20:26:17 +0530
commit3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb (patch)
treea23adc82d229a2b919ea1fcfb11e343671619518 /modules/desktop/sxhkd
parentd308f652cd9aab7c68daaf82abe1ec01ffaa698c (diff)
downloadhome-manager-config-3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb.tar.gz
home-manager-config-3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb.zip
Some minor code refactoring
Diffstat (limited to 'modules/desktop/sxhkd')
-rw-r--r--modules/desktop/sxhkd/default.nix8
-rw-r--r--modules/desktop/sxhkd/keybindings/brightnessctl.nix2
-rw-r--r--modules/desktop/sxhkd/keybindings/bspwm.nix10
-rw-r--r--modules/desktop/sxhkd/keybindings/maim.nix2
-rw-r--r--modules/desktop/sxhkd/keybindings/pamixer.nix4
-rwxr-xr-xmodules/desktop/sxhkd/scripts/keybindings.sh7
6 files changed, 16 insertions, 17 deletions
diff --git a/modules/desktop/sxhkd/default.nix b/modules/desktop/sxhkd/default.nix
index 98338c2..3102efe 100644
--- a/modules/desktop/sxhkd/default.nix
+++ b/modules/desktop/sxhkd/default.nix
@@ -16,23 +16,23 @@
(import ./keybindings/maim.nix { inherit pkgs createKeybinding lib; })
(import ./keybindings/pamixer.nix { inherit pkgs createKeybindingBase lib; })
(import ./keybindings/playerctl.nix { inherit pkgs createKeybindingBase lib; })
-
+
(createKeybinding
"s"
"Show keybindings."
"kitty --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}"
)
-
+
(createKeybinding
"r"
"Application launcher."
"rofi -show drun")
-
+
(createKeybinding
"t"
"Launch terminal."
"kitty")
-
+
(createKeybinding
"f"
"Launch File Manager."
diff --git a/modules/desktop/sxhkd/keybindings/brightnessctl.nix b/modules/desktop/sxhkd/keybindings/brightnessctl.nix
index acb4ea2..6cdf3e7 100644
--- a/modules/desktop/sxhkd/keybindings/brightnessctl.nix
+++ b/modules/desktop/sxhkd/keybindings/brightnessctl.nix
@@ -7,7 +7,7 @@ in lib.mkMerge [
"XF86MonBrightnessDown"
"Decrease brightness."
"${brightnessctl} set 5%-")
-
+
(createKeybindingBase
"XF86MonBrightnessUp"
"Increase brightness."
diff --git a/modules/desktop/sxhkd/keybindings/bspwm.nix b/modules/desktop/sxhkd/keybindings/bspwm.nix
index ed62ed4..ffa7d6c 100644
--- a/modules/desktop/sxhkd/keybindings/bspwm.nix
+++ b/modules/desktop/sxhkd/keybindings/bspwm.nix
@@ -7,27 +7,27 @@ in lib.mkMerge [
"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}"
diff --git a/modules/desktop/sxhkd/keybindings/maim.nix b/modules/desktop/sxhkd/keybindings/maim.nix
index 7b748da..b66ec98 100644
--- a/modules/desktop/sxhkd/keybindings/maim.nix
+++ b/modules/desktop/sxhkd/keybindings/maim.nix
@@ -7,7 +7,7 @@ in lib.mkMerge [
"p"
"Take screenshot of selected area and save to clipboard"
"${maim} -s | xclip -selection clipboard -t image/png")
-
+
(createKeybinding
"shift + p"
"Take screenshot of selected area and save to ~/Pictures/Screenshots"
diff --git a/modules/desktop/sxhkd/keybindings/pamixer.nix b/modules/desktop/sxhkd/keybindings/pamixer.nix
index 3543d8f..a45bf83 100644
--- a/modules/desktop/sxhkd/keybindings/pamixer.nix
+++ b/modules/desktop/sxhkd/keybindings/pamixer.nix
@@ -7,12 +7,12 @@ in lib.mkMerge [
"XF86AudioLowerVolume"
"Decrease volume."
"${pamixer} --decrease 5")
-
+
(createKeybindingBase
"XF86AudioRaiseVolume"
"Increase volume."
"${pamixer} --increase 5")
-
+
(createKeybindingBase
"XF86AudioMute"
"Mute audio."
diff --git a/modules/desktop/sxhkd/scripts/keybindings.sh b/modules/desktop/sxhkd/scripts/keybindings.sh
index 01bb05f..1548f1c 100755
--- a/modules/desktop/sxhkd/scripts/keybindings.sh
+++ b/modules/desktop/sxhkd/scripts/keybindings.sh
@@ -36,13 +36,12 @@ border_line="├$(printf '%.0s─' $(seq 1 $max_keybinding_length))┼$(printf '
# Print table header with borders
echo "┌$(printf '%.0s─' $(seq 1 $max_keybinding_length))┬$(printf '%.0s─' $(seq 1 $description_width))┐"
printf "│ %-*s │ %-*s │\n" "$max_keybinding_content_length" "KEYBINDING" "$description_content_width" "DESCRIPTION"
-
- # Initialize variables
+
description=""
-
+
# Load the sxhkd file into an array
mapfile -t lines < "$SXHKD_FILE"
-
+
# Loop through lines for output
for line in "${lines[@]}"; do
# Check if the line is a comment