summaryrefslogtreecommitdiff
path: root/sway/toEmacs.sh~
blob: 30d1dc354b67d32dca91e910bb08906eeab89290 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/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