.dotfiles/.scripts/switcher.fish
2024-10-23 19:31:58 +03:00

16 lines
353 B
Fish
Executable file

#!/usr/bin/fish
set lock /tmp/window_switcher_lock
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