lots: shellcheck, streaming stuff, fixes
[distro-setup] / obs-i3-interlude
diff --git a/obs-i3-interlude b/obs-i3-interlude
new file mode 100755 (executable)
index 0000000..303dec1
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e; . /usr/local/lib/bash-bear; set +e
+
+if [[ -e /tmp/no-obs-auto-scene-switch ]]; then
+  rm -f /tmp/no-obs-auto-scene-switch
+  if [[ -s /tmp/last-obs-i3-mark ]]; then
+    p=$(cat /p/obs-ws-pass)
+    mark=$(cat /tmp/last-obs-i3-mark)
+    obs-cmd -w obsws://localhost:4455/$p scene switch $mark
+  fi
+else
+  touch /tmp/no-obs-auto-scene-switch
+  obs-cmd -w obsws://localhost:4455/$p scene switch interlude
+fi