dotnix/modules/home/scripts/keybinds.nix
2025-03-29 19:05:05 +01:00

18 lines
604 B
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ pkgs }:
pkgs.writeShellScriptBin "list-keybinds" ''
# check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
msg=' NOTE : Clicking with Mouse or Pressing ENTER will have NO function'
keybinds=$(cat ~/.config/hypr/hyprland.conf | grep -E '^bind')
# replace #modifier with SUPER in the displayed keybinds for rofi
display_keybinds=$(echo "$keybinds" | sed 's/\$modifier/SUPER/g')
# use rofi to display the keybinds with the modified content
echo "$display_keybinds" | rofi -dmenu -i -config ~/.config/rofi/config-long.rasi -mesg "$msg"
''