| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | |
| 4 | source "$(dirname "$0")/_lib.sh" |
| 5 | conf_dir="$HOME/.config/sway/config.d" |
| 6 | |
| 7 | awk ' |
| 8 | /^[[:space:]]*#:/ { sub(/^[[:space:]]*#:[[:space:]]*/, ""); desc=$0; next } |
| 9 | /^[[:space:]]*bindsym/ && desc != "" { |
| 10 | key=$2; if (key ~ /^--/) key=$3 |
| 11 | gsub(/\$mod/, "Super", key); gsub(/\$alt/, "Alt", key) |
| 12 | gsub(/\$left/, "h", key); gsub(/\$down/, "j", key) |
| 13 | gsub(/\$up/, "k", key); gsub(/\$right/, "l", key) |
| 14 | printf "%-26s %s\n", key, desc |
| 15 | desc=""; next |
| 16 | } |
| 17 | { desc="" } |
| 18 | ' "$conf_dir"/*.conf \ |
| 19 | | menu "Keybindings" --width 720 --height 560 >/dev/null |