Add --print option to output keybindings to terminal

This commit is contained in:
Ryan Hughes
2026-01-03 13:34:28 -05:00
parent 36095c1ac8
commit c82b1bfb7e

View File

@@ -212,18 +212,26 @@ prioritize_entries() {
cut -f2- cut -f2-
} }
monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height') output_keybindings() {
menu_height=$((monitor_height * 40 / 100)) build_keymap_cache
build_keymap_cache {
dynamic_bindings
static_bindings
} |
sort -u |
parse_keycodes |
parse_bindings |
prioritize_entries
}
{ if [[ "$1" == "--print" || "$1" == "-p" ]]; then
dynamic_bindings output_keybindings
static_bindings else
} | monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height')
sort -u | menu_height=$((monitor_height * 40 / 100))
parse_keycodes |
parse_bindings | output_keybindings |
prioritize_entries | walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height"
walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height" fi