mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
feat(tools): add Brave tab and Umbriel window management helpers
This commit is contained in:
1 parent
b555282d9c
commit
886171171d
3 files changed
+67
-2
No files matched your search
@@ -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')
|
||||
|
||||
|
||||
Reference in new issue
Block a user