aboutsummaryrefslogtreecommitdiff
path: root/dot_local/bin/executable_wofi-window-switcher
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2025-08-21 13:21:45 -0400
committerRyan Kavanagh <rak@rak.ac>2025-08-21 13:21:45 -0400
commitf19f5df73ac0fdc3efa14649c4b646bcc4de84f4 (patch)
treec323a796deb32800dd3dc054fe778f1787d3f953 /dot_local/bin/executable_wofi-window-switcher
parentAdopt straight.el (diff)
Move ~/bin to ~/.local/bin
Diffstat (limited to 'dot_local/bin/executable_wofi-window-switcher')
-rw-r--r--dot_local/bin/executable_wofi-window-switcher12
1 files changed, 12 insertions, 0 deletions
diff --git a/dot_local/bin/executable_wofi-window-switcher b/dot_local/bin/executable_wofi-window-switcher
new file mode 100644
index 0000000..2344093
--- /dev/null
+++ b/dot_local/bin/executable_wofi-window-switcher
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+
+swaymsg -t get_tree | \
+ jq -r '.nodes[].nodes[] |
+ if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes |
+ .[] | select(.nodes==[]) | ((.id | tostring) + " [" + (.app_id // .window_properties.class) + "] " + .name)' | \
+ grep -v __i3_scratch |
+ wofi -d -i | {
+ read -r id name
+ swaymsg "[con_id=$id]" focus
+}