Prevent OBS from restoring session on reboot

skyspa

New Member
Hi y’all,

I’m trying to setup my OBS so that it starts recording immediately on login/startup. I am using XFCE on Fedora Linux. I initially thought this would be as easy as going into the Session and Startup dialog and adding an entry to start it using `obs --startreplaybuffer --minimize-to-tray`.

This works great if I intentionally exited OBS before shutting down. It’ll start the replay buffer right away. The problem came when I tested a real world scenario - where I want to forget about OBS unless I need to clip something. If I shut down the computer gracefully (not explicitly quitting OBS), it seems OBS or XFCE saves the session, and tries to pickup where I left off when I shut down. OBS starts before my session startup entry does, and when said entry is launched, there’s already an OBS running, so it gives me an error. As I don’t want multiple sessions, I made a simple modification to the command in my startup entry. It’s now set to a small script that only opens it if it’s not detected as running already:

Bash:
OBSCMD="obs --startreplaybuffer --minimize-to-tray" && if ! pgrep -f "^$OBSCMD$"; then $OBSCMD; fi

This script eliminates the error, however OBS or XFCE is still launching its instance of OBS before my script runs. According to `ps aux | grep ops`, it’s being invoked by `obs -session xxxx`.

This wouldn’t be an issue, but the session doesn’t restore with replay on, nor is it minimized to the tray, so it’s obnoxious.

I’m curious how others approach this issue. Does anyone have any suggestions to prevent OBS from trying to restore its session if I don’t close if before shutdown? Or to restore the session with the same options as before - that being in the tray and with replay buffer recording? I realize this issue may be related to XFCE, not OBS, so I've posted in a couple places. If I find a fix, I'll update both threads.
 
Top