Bind SUPER + CTRL + a number to the bar's right panels (#6702)
The letters name a panel; the numbers count them. One is the leftmost panel in the right section, so the number matches the icon a user would point at: a widget with no panel of its own is passed over, and so is one that is hiding itself. Counting rather than naming means the hotkeys follow the bar. Rearranging the section, or adding a widget to it, renumbers the panels with no binding to rewrite. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
efe805387e
commit
5edc3497fa
@@ -183,6 +183,23 @@ assert(
|
||||
'bar tabs between panels within one bar surface'
|
||||
)
|
||||
|
||||
// A positional hotkey means "the third panel in this section", so it counts the
|
||||
// panels the bar actually draws. Reusing the tab-order walk is what keeps the
|
||||
// count honest: a widget with no panel and a hidden one are already passed over
|
||||
// there, and reading the layout config a second time would count both.
|
||||
assert(
|
||||
/function panelWidgetIdAt\(region, index\) \{[\s\S]*?panelNavigationSlots\(String\(region \|\| ""\), null\)/.test(barSource),
|
||||
'bar counts positional panels off the drawn tab order'
|
||||
)
|
||||
assert(
|
||||
/var slot = slots\[Math\.round\(Number\(index\)\) - 1\]/.test(barSource),
|
||||
'positional panels are one-based, and anything off the end lands on no slot'
|
||||
)
|
||||
assert(
|
||||
/function togglePanelAt\(section: string, index: string\): string \{[\s\S]*?shell\.bar\.panelWidgetIdAt\(section, index\)[\s\S]*?shell\.toggle\(id, "\{\}"\)/.test(shellSource),
|
||||
'shell toggles a bar panel by its position over IPC'
|
||||
)
|
||||
|
||||
const clockSlot = { id: 'clock' }
|
||||
const traySlot = { id: 'tray' }
|
||||
const horizontalTargets = [
|
||||
|
||||
@@ -175,6 +175,21 @@ if grep -Fq $'SUPER + CTRL + X Toggle dictation' <<<"$missing_voxtype_output"; t
|
||||
fi
|
||||
pass "missing Voxtype skips dictation bindings"
|
||||
|
||||
# The panel hotkeys claim a row of keys that workspace switching already uses
|
||||
# under other modifiers, so the count matters as much as the bindings: a tenth
|
||||
# claim on SUPER + CTRL + a number is a collision with one of these.
|
||||
panels_home="$tmpdir/panels-home"
|
||||
mkdir -p "$panels_home"
|
||||
panels_output=$(run_omarchy_bindings "$panels_home")
|
||||
for panel in 1 2 3 4 5 6 7 8 9; do
|
||||
grep -Fqx "SUPER + CTRL + code:$((panel + 9))"$'\t'"Bar panel $panel" <<<"$panels_output" ||
|
||||
fail "bar panel hotkeys count the right section" "$panel"
|
||||
done
|
||||
number_claims=$(cut -f1 <<<"$panels_output" | grep -cE '^SUPER \+ CTRL \+ code:1[0-9]$' || true)
|
||||
(( number_claims == 9 )) ||
|
||||
fail "only the bar panel hotkeys bind SUPER + CTRL + a number" "$number_claims"
|
||||
pass "bar panel hotkeys bind SUPER + CTRL + a number without a collision"
|
||||
|
||||
migration=$(grep -rl 'Move stock Hyprland user overrides into package defaults' "$ROOT/migrations" | head -n 1 || true)
|
||||
[[ -n $migration ]] || fail "Hyprland default config migration exists"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user