X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;ds=sidebyside;f=obs-auto-scene-switch-toggle;fp=obs-auto-scene-switch-toggle;h=cc067b1064a04ff392097444dc16e26850d34592;hb=d67edcdca8795a4bca116aa532d02dda246a6f53;hp=0000000000000000000000000000000000000000;hpb=a9e3d60b4254cd5c6216c4b3e7f8cd5cc5107fad;p=distro-setup diff --git a/obs-auto-scene-switch-toggle b/obs-auto-scene-switch-toggle new file mode 100755 index 0000000..cc067b1 --- /dev/null +++ b/obs-auto-scene-switch-toggle @@ -0,0 +1,16 @@ +#!/bin/bash +set -e; . /usr/local/lib/bash-bear; set +e + +# the last select is so jq -e will tell us when it isn't found, which is +# a bit cooler than doing an output comparison... maybe? I'm not sure +if i3-msg -t get_tree | jq -e '.. | select(.focused? == true) | select(.floating == "user_on")' &>/dev/null; then + exit 0 +fi + +f=/tmp/no-obs-auto-scene-switch + +if [[ -e $f ]]; then + rm -f $f +else + touch $f +fi