scripts/sway/sway-alt-tab.sh

9 lines
314 B
Bash

#!/bin/bash
swaymsg -t get_tree |
jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes | .[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)' |
wofi --show dmenu -c .dotfiles/wofi/sidebar | {
read -r id name
swaymsg "[con_id=$id]" focus
}