Created
June 2, 2019 14:04
-
-
Save tnymlr/3d3eca75e46389916cc5a2a70f29775d to your computer and use it in GitHub Desktop.
How to choose a window with dmenu in sway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swaymsg -t get_tree \ | |
| jq -r '..| objects | select(.type == "con") | select(.name != null) | select(.nodes | length < 1) | {id: .id | tostring, name: .name, app_id: .app_id} | .id + ": " + .name + " - " + .app_id' \ | |
| dmenu -l 30 \ | |
| cut -d ':' -f 1 \ | |
| xargs -I {} swaymsg '[con_id="{}"] focus' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This one will find all of the windows managed by sway, list them using dmenu allowing user to choose one with fuzzy search and then switch to the chosen window.
It works the same way if one replaces dmenu with bemenu