hyprland: add SUPER+arrow workspace cycling and overview binds
SUPER+Left/Right cycle existing workspaces on the active monitor (m+1/m-1 with cycling enabled), SUPER+Up opens the hyprshell overview scoped to the current monitor (create/manage workspaces there), and SUPER+Down closes the overview again. Adds binds-help.sh cheat sheet (SHIFT+SUPER+H) and overview-close.sh helper.
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Searchable cheat sheet of Hyprland keybindings, shown in wofi.
|
||||
#
|
||||
# The descriptions shown here come from the `desc` option passed to hl.bind()
|
||||
# in ~/.config/hypr/binds.lua, read back at runtime via `hyprctl binds -j`,
|
||||
# so the cheat sheet always matches the live config.
|
||||
set -u
|
||||
|
||||
mods_from_mask() {
|
||||
local mask="$1" out=""
|
||||
(( mask & 1 )) && out="${out:+$out + }SHIFT"
|
||||
(( mask & 4 )) && out="${out:+$out + }CTRL"
|
||||
(( mask & 8 )) && out="${out:+$out + }ALT"
|
||||
(( mask & 64 )) && out="${out:+$out + }SUPER"
|
||||
(( mask & 128 )) && out="${out:+$out + }MOD5"
|
||||
printf "%s" "$out"
|
||||
}
|
||||
|
||||
hyprctl binds -j |
|
||||
jq -rc '.[] | select(.has_description) | select(.description != "") | [.modmask, .key, .description] | @tsv' |
|
||||
while IFS=$'\t' read -r mask key desc; do
|
||||
if (( mask )); then
|
||||
mods="$(mods_from_mask "$mask")"
|
||||
printf '%s + %s\t%s\n' "$mods" "$key" "$desc"
|
||||
else
|
||||
printf '%s\t%s\n' "$key" "$desc"
|
||||
fi
|
||||
done |
|
||||
sort -k1,1 |
|
||||
column -t -s $'\t' |
|
||||
wofi --dmenu --prompt "Hyprland keybinds" >/dev/null
|
||||
Reference in New Issue
Block a user