dotfiles/.config/sway/scripts/window-switcher

10 lines
326 B
Bash
Executable File

#!/bin/bash
# window switcher for sway by rofi
swaymsg -t get_tree |
jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes | .[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)' |
rofi -dmenu -p "window switcher" | {
read -r id name
swaymsg "[con_id=$id]" focus
}