summaryrefslogtreecommitdiff
path: root/scripts/focus-sway
blob: e3c63fb5166958aa4dc1231ec2f3c54934e6873a (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

# Get available windows
windows=$(swaymsg -t get_tree | jq -r '.nodes[1].nodes[].nodes[] | .. | (.id|tostring) + " " + .name?' | grep -e "[0-9]* ."  )

# Select window with rofi
selected=$(echo "$windows" | swenu -coil 10 | awk '{print $1}')

# Tell sway to focus said window
swaymsg [con_id="$selected"] focus