fix(binds): window not wrapping text

This commit is contained in:
2026-07-23 20:15:51 +01:00
parent 0513ab1abb
commit b62db3a09d

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
hyprctl -j binds | jq -r ' DATA=$(hyprctl -j binds | jq -r '
def mods(m): def mods(m):
[ if m >= 64 then "SUPER" else empty end, [ if m >= 64 then "SUPER" else empty end,
if (m % 16) >= 8 then "ALT" else empty end, if (m % 16) >= 8 then "ALT" else empty end,
@@ -11,9 +11,16 @@ hyprctl -j binds | jq -r '
| sort_by(.k) | sort_by(.k)
| (map(.k | length) | max) as $w | (map(.k | length) | max) as $w
| .[] | "\(.k + (" " * ($w - (.k | length)))) \(.d)" | .[] | "\(.k + (" " * ($w - (.k | length)))) \(.d)"
' | pr -2 -t -w 160 \ ')
| yad --text-info \
--title="Hyprland Keybinds" \ COLS=$(awk '{ if (length > m) m = length } END { print m }' <<< "$DATA")
--width=1250 --height=560 --center \ ROWS=$(wc -l <<< "$DATA")
--fontname="monospace 10" \
--no-buttons --wrap=false PRW=$(( COLS * 2 + 4 ))
PX=$(( PRW * 7 + 60 ))
PY=$(( (ROWS / 2 + 2) * 18 + 60 ))
pr -2 -t -w "$PRW" <<< "$DATA" \
| yad --text-info --title="Hyprland Keybinds" \
--width="$PX" --height="$PY" --center \
--fontname="monospace 10" --no-buttons --wrap=false