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 dynamic_bindings
static_bindings static_bindings
} | } |
sort -u | sort -u |
parse_keycodes | parse_keycodes |
parse_bindings | parse_bindings |
prioritize_entries | prioritize_entries
walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height" }
if [[ "$1" == "--print" || "$1" == "-p" ]]; then
output_keybindings
else
monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height')
menu_height=$((monitor_height * 40 / 100))
output_keybindings |
walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height"
fi