Add missing sway-switch-app script
This commit is contained in:
parent
08f8ce2723
commit
6385a436eb
1 changed files with 7 additions and 0 deletions
7
bin/sway-switch-app
Executable file
7
bin/sway-switch-app
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -exo pipefail
|
||||
app_id="$1"
|
||||
swaymsg -t get_tree \
|
||||
| jq -r "recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.app_id==\"${app_id}\")|select(.focused==false)|\"[con_id=\"+ (.id|tostring) + \"] focus\"" \
|
||||
| head -n 1 \
|
||||
| xargs -e swaymsg
|
Loading…
Reference in a new issue