aboutsummaryrefslogtreecommitdiffstats
path: root/sxhkd
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-20 22:05:49 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-20 22:05:49 +0530
commit275903e8ecc9161c6c690a83ca5b1eb7b67899a4 (patch)
tree02a4550da8b9beea909c131d45e5a8e9aa600be9 /sxhkd
parent605b9659932356d67a26118438ae513a14f4c895 (diff)
downloadhome-manager-config-275903e8ecc9161c6c690a83ca5b1eb7b67899a4.tar.gz
home-manager-config-275903e8ecc9161c6c690a83ca5b1eb7b67899a4.zip
Added git information to zsh prompt.
Changed configuration of rofi to be more consistent with the other windows. Changed mod key to alt key.
Diffstat (limited to 'sxhkd')
-rw-r--r--sxhkd/default.nix10
-rw-r--r--sxhkd/scripts/show-keybindings.sh13
2 files changed, 20 insertions, 3 deletions
diff --git a/sxhkd/default.nix b/sxhkd/default.nix
index 00621bf..762c6b0 100644
--- a/sxhkd/default.nix
+++ b/sxhkd/default.nix
@@ -3,16 +3,20 @@
{
services.sxhkd.enable = true;
+ xdg.configFile."sxhkd/scripts/show-keybindings.sh" = {
+ source = ./scripts/show-keybindings.sh;
+ executable = true;
+ };
+
services.sxhkd.keybindings =
let
modKey = "alt";
createKeybinding = keybinding: description: "# ${description}\n${modKey} + ${keybinding}";
in {
- # TODO: Currently not working properly
${(createKeybinding
- "i"
+ "s"
"Show keybindings.")}
- = ''awk '/^#/{desc=substr($0, 3)} /^[a-z]/ { cmd=$0; print cmd " : " desc }' ~/.config/sxhkd/sxhkdrc | rofi -dmenu -i -p "Keybindings"'';
+ = "$HOME/.config/sxhkd/scripts/show-keybindings.sh";
${(createKeybinding
"r"
diff --git a/sxhkd/scripts/show-keybindings.sh b/sxhkd/scripts/show-keybindings.sh
new file mode 100644
index 0000000..db7863d
--- /dev/null
+++ b/sxhkd/scripts/show-keybindings.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+SXHKD_CONFIG="$HOME/.config/sxhkd/sxhkdrc"
+
+awk '
+ /^#/ {
+ desc = substr($0, 3)
+ }
+ /^[[:alnum:]]/ {
+ cmd = $0
+ getline
+ print cmd " : " desc
+ }
+' "$SXHKD_CONFIG" | rofi -dmenu -i -p "Keybindings"