summaryrefslogtreecommitdiff
path: root/config/sway/toEmacs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/sway/toEmacs.sh')
-rwxr-xr-xconfig/sway/toEmacs.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/config/sway/toEmacs.sh b/config/sway/toEmacs.sh
new file mode 100755
index 0000000..aacf2c1
--- /dev/null
+++ b/config/sway/toEmacs.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+#get be to emacs and back
+
+f=$(swaymsg -t get_tree | jq '.. | objects | select(.focused) | .app_id')
+
+
+if [ $f = '"emacs"' ]; then
+ swaymsg '[con_mark="E"] focus'
+else
+ swaymsg 'mark --add "E"; [app_id="emacs"] focus'
+fi