From c82b1bfb7e2f39617775722cb5577ec9a5ca2b88 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sat, 3 Jan 2026 13:34:28 -0500 Subject: [PATCH] Add --print option to output keybindings to terminal --- bin/omarchy-menu-keybindings | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/bin/omarchy-menu-keybindings b/bin/omarchy-menu-keybindings index 39a9e0b6..1c40d828 100755 --- a/bin/omarchy-menu-keybindings +++ b/bin/omarchy-menu-keybindings @@ -212,18 +212,26 @@ prioritize_entries() { cut -f2- } -monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height') -menu_height=$((monitor_height * 40 / 100)) +output_keybindings() { + build_keymap_cache -build_keymap_cache + { + dynamic_bindings + static_bindings + } | + sort -u | + parse_keycodes | + parse_bindings | + prioritize_entries +} -{ - dynamic_bindings - static_bindings -} | - sort -u | - parse_keycodes | - parse_bindings | - 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