improve licensing
[distro-setup] / obs-auto-scene-switch-toggle
1 #!/bin/bash
2 set -e; . /usr/local/lib/bash-bear; set +e
3
4 # the last select is so jq -e will tell us when it isn't found, which is
5 # a bit cooler than doing an output comparison... maybe? I'm not sure
6 if i3-msg -t get_tree | jq -e '.. | select(.focused? == true) | select(.floating == "user_on")' &>/dev/null; then
7 exit 0
8 fi
9
10 f=/tmp/no-obs-auto-scene-switch
11
12 if [[ -e $f ]]; then
13 rm -f $f
14 else
15 touch $f
16 fi