feat(tools): add Brave tab and Umbriel window management helpers

This commit is contained in:
Prad Nukala committed 2026-10-18 13:29:52 -04:00
1 parent b555282d9c
commit 886171171d
3 files changed
+67 -2

No files matched your search

+3 -2
View File
@@ -11,11 +11,12 @@ pattern=$1
shift
# Matches in a stable order (window id); the one after the focused match, or
# the first when focus is elsewhere.
# the first when focus is elsewhere. `.active` is the one window with keyboard
# focus; `.focused` is set on every output's last-focused window.
target=$(umbriel windows --json | jq -r --arg p "$pattern" '
[.[] | select(.scratchpad == "" and (.app_id | test($p; "i")))] | sort_by(.id)
| if length == 0 then empty
else (map(.focused) | index(true)) as $i
else (map(.active) | index(true)) as $i
| if $i == null then .[0].id else .[($i + 1) % length].id end
end')