From 69c4e19e986693911057420ea90614edfbe6e345 Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 9 Nov 2022 18:45:49 -0300 Subject: [PATCH] sway: switch_window --- .config/sway/config | 2 ++ .local/bin/sway-switch_window | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100755 .local/bin/sway-switch_window diff --git a/.config/sway/config b/.config/sway/config index 8aeed0e..dadb4b8 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -138,6 +138,8 @@ input * { bindsym Mod4+Mod1+Prior exec sway-switch_workspace prev move bindsym Mod4+Mod1+Next exec sway-switch_workspace next move + bindsym $mod+space exec sway-switch_window + # Layout stuff: bindsym $mod+a focus parent bindsym $mod+Shift+a focus child diff --git a/.local/bin/sway-switch_window b/.local/bin/sway-switch_window new file mode 100755 index 0000000..6ccdcf1 --- /dev/null +++ b/.local/bin/sway-switch_window @@ -0,0 +1,7 @@ +#!/bin/sh +swaymsg -t get_tree | +jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes | .[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)' | +fuzzel-run -d | { + read -r id name + swaymsg "[con_id=$id]" focus +}