2024-10-23 00:08:59 +03:00
|
|
|
#!/usr/bin/fish
|
|
|
|
|
2024-10-23 19:31:58 +03:00
|
|
|
set lock /tmp/window_switcher_lock
|
2024-10-23 00:08:59 +03:00
|
|
|
|
2024-10-23 19:31:58 +03:00
|
|
|
test -e $lock && exit
|
|
|
|
|
|
|
|
touch $lock
|
|
|
|
|
|
|
|
set windows (swaymsg -t get_tree -r)
|
|
|
|
set query '.. | select(.app_id?) | (.pid|tostring) + " " + .app_id + " " + .name'
|
|
|
|
set fzf_options --with-nth 2..
|
|
|
|
set id (echo $windows | jq -r $query | fzf $fzf_options | awk '{print $1}')
|
|
|
|
|
|
|
|
swaymsg "[pid=$id]" focus
|
|
|
|
|
|
|
|
rm $lock
|