;;
esac
+found=false
+
p=$(cat /p/obs-ws-pass)
# note, if the desktop audio is already on, this will do the wrong thing.
# obs-cmd needs more commands. But, I don't use desktop audio for anything
# else atm.
-obs-cmd -w obsws://localhost:4455/$p toggle-mute 'Desktop Audio'
+if pgrep '^obs$' &>/dev/null; then
+ # this is so the script keeps working when obs is not running, but
+ # also doesn't ignore errors.
+ found=true
+ obs-cmd -w obsws://localhost:4455/$p toggle-mute 'Desktop Audio'
+fi
mpv --profile=a $clip ||:
-obs-cmd -w obsws://localhost:4455/$p toggle-mute 'Desktop Audio'
+
+if $found; then
+ obs-cmd -w obsws://localhost:4455/$p toggle-mute 'Desktop Audio'
+fi