summaryrefslogtreecommitdiff
path: root/config/sway/switch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/sway/switch.sh')
-rwxr-xr-xconfig/sway/switch.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/config/sway/switch.sh b/config/sway/switch.sh
new file mode 100755
index 0000000..62751b8
--- /dev/null
+++ b/config/sway/switch.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+a="$(swaymsg -t get_tree | jq '.. | objects | select(.type == "con") | select(.focused == true) | .marks | index("t") != null')"
+
+#echo $a
+if [ $a = "true" ]; then
+ swaymsg '[con_mark="l"] focus'
+else
+ swaymsg 'mark --add "l"; [con_mark="t"] focus'
+fi
+