Correct way to close OBS from a script?

AaronD

Active Member
I have this, and it works (if I comment out the zenity message and exit 0 of course - I don't want this function to be "live" quite yet):
Bash:
#!/bin/bash

# Called from OBS -> Advanced Scene Switcher -> "Run" action



zenity --info --text="Would have closed OBS"
exit 0



# Close OBS

kill -TERM $(pidof obs)
But I'm not familiar enough with the signal types to be comfortable with that methodology. Is that the "right" way to do it? Should I use a different signal? Should I do something different altogether?

The idea is to allow a bunch of minimally-trained people to run the artistic part of a show, while the automation takes care of as many fiddly bits, technical "gotchas", and opportunities for unnoticed mistakes as it can. One of those problems is that "whack-a-mole" closing windows when everything is done, does not reopen them correctly.

So I want to have OBS essentially "close itself", with some help from this external script. That *does* reopen the Multiview and Projector correctly, the next time it's used. This, combined with everything else, allows me to tell people to just turn the computer on, switch scenes when needed, and walk away. The automation will take care of the rest.
 
Top