How to set up switching scenes with streamdeck-ui for OBS

ThomasCameron

New Member
Howdy, all! I have set up streamdeck-ui on my Fedora 35 box, and I get how to set up launching OBS with a specific scene (/usr/bin/obs --scene "My Desktop"), but when I then try to change to another scene, it warns me that OBS is already running. I know I can use hotkeys inside of OBS to switch scenes, but OBS has to have focus to use hotkeys, and that is almost never the case. Is there a way to make streamdeck-ui call OBS to just switch scenes? It works trivially in Windows, but I really, really don't want to have to boot into Windows to stream. Any pointers? Thanks!
 

ThomasCameron

New Member
OK, I figured out a way. It's not pretty, but it works pretty well.

First, I set up hot keys in OBS. Go into settings, then hotkeys. For each scene, I set up a hotkey. So for my webcam capture scene, where I'm just capturing my web camera, I chose F1. For my second scene, where I'm just capturing my desktop, I set the hotkey as F2. Then with the third scene, where I have my video in the lower right corner of the desktop capture, I chose F3.

I installed xdotool (sudo yum -y install xdotool). I figured out that xdotool search --name "OBS 27" would find the parent window of the OBS app. Originally, I was trying to just do xdotool search --name "OBS" and I got multiple window IDs. I think it's because OBS has multiple stacked windows for each of the dockable windows like Scenes, Sources, Audio Mixer, Controls, and so on.

Anyway, I then figured out that I could run:

/usr/bin/xdotool search --name "OBS 27.2.1" key F1

to pass the F1 key to the main window of OBS, and it would use that hotkey to toggle to my video capture scene. Then:

/usr/bin/xdotool search --name "OBS 27.2.1" key F2

would toggle to scene two, my desktop capture scene. Finally, I added:

/usr/bin/xdotool search --name "OBS 27.2.1" key F3

to my streamdeck to toggle my combined desktop capture plus video. It works perfectly.

I hope this helps someone else!
 

JohnTwenty

New Member
Thank you very much!!
I had the same problem.
I would just like to add that it is important to use dashes (-) and not underscores(_) or blanks ( ).

Cheers
John
 

nancieuhh

New Member
Hi,

I have also used the same version of this application but am looking for a permanent solution for this error.


Thanks
Nancie
 

ThomasCameron

New Member
The setup I use, using:

/usr/bin/xdotool search --name "OBS 27.2.1" key F1
/usr/bin/xdotool search --name "OBS 27.2.1" key F2
/usr/bin/xdotool search --name "OBS 27.2.1" key F3

and so on, works perfectly for me. It's not super pretty, but I've been using it for streaming literally every day since March. It's almost July now, and it works just fine.
 
Top