streamdeck-ui icon indicating copy to clipboard operation
streamdeck-ui copied to clipboard

Insert OBS keypress without changing focus ?

Open ghost opened this issue 4 years ago • 17 comments

Is there a way to tell streamdeck to change a scene in OBS whitout changing the current window focus ?

Stealing the focus makes it useless when youre playing a game and want to switch something

ghost avatar Mar 13 '20 21:03 ghost

I successfully got it to work by using shell scripts. For example, I have a script that has this line:

/usr/bin/wmctrl -a "OBS Studio 0" ; /usr/bin/xdotool key ctrl+alt+shift+C

This script is called by one of the buttons.

Now the prob is that the StreamDeck looses its USB connection... I can make this work once, maybe twice, then I have to exit the streamdeck app, disconnect/reconnect the deck and open the app again to make it work.

I am waiting for a new USB 3 Hub from Amazon to continue testing.

adelgado7 avatar May 01 '20 18:05 adelgado7

I am waiting for a new USB 3 Hub from Amazon to continue testing.

How's your "continued testing" going? I am considering moving my streaming setup completely over to Linux. For that I'd need Streamdeck to work flawlessly. Ideally without too much custom work going on. :)

christianparpart avatar Jul 08 '20 10:07 christianparpart

I successfully got it to work by using shell scripts. For example, I have a script that has this line:

/usr/bin/wmctrl -a "OBS Studio 0" ; /usr/bin/xdotool key ctrl+alt+shift+C

This script is called by one of the buttons.

Now the prob is that the StreamDeck looses its USB connection... I can make this work once, maybe twice, then I have to exit the streamdeck app, disconnect/reconnect the deck and open the app again to make it work.

I am waiting for a new USB 3 Hub from Amazon to continue testing.

This switches focus, thus being useless when you need an active input somwhere.

ghost avatar Sep 04 '20 14:09 ghost

I created a fork where I added support for OBS using the obs-websocket plugin. This allows you to switch scenes in OBS without having to switch focus between windows since it's communicating using websockets between streamdeck-ui and OBS.

Also merged a bunch of other items in this fork, see the readme for details.

image

dodgyrabbit avatar Feb 27 '21 02:02 dodgyrabbit

@dodgyrabbit,

Would you be interested in making your fork the main project? And/or being the core maintainer of this repository? I currently have too many projects that I maintain, but I don't want this one to die, because I use it myself as well!

~Timothy

timothycrosley avatar Feb 27 '21 04:02 timothycrosley

Hi @timothycrosley, I'd be happy to help. Maybe let's keep it here for now and I can help get some of the PR merged and issues resolved. Will need a bit of your help to get going. How would you like to go about this? You can assign the appropriate access rights to me and I will take it from here. In order to ultimately publish new builds, you'd have to do that (PIP credentials, account etc). My first goal would be to get some of the PRs cleaned/merged and some of the issues reviewed/closed. I'll also update the docs based on my experience to make it easier for people to help with development.

BTW - I've got a couple more things waiting in the wings (core dump bug on exit, support for kasa smart switches and experimenting with drag/drop rearranging of buttons).

dodgyrabbit avatar Feb 28 '21 00:02 dodgyrabbit

@dodgyrabbit @timothycrosley I'm happy to help as well. I've been using the fork and would be happy to help testing PRs to get them reviewed. I don't need merge access, just saying that once @dodgyrabbit has merge access you can tag me on PRs to get an extra reviewer.

tylerjw avatar Mar 17 '21 20:03 tylerjw

I'll be happy to test. I have been crazy busy but still produce at least a video a day. I run entirely on Pop_OS.

On Wed, Mar 17, 2021 at 3:42 PM Tyler Weaver @.***> wrote:

@dodgyrabbit https://github.com/dodgyrabbit @timothycrosley https://github.com/timothycrosley I'm happy to help as well. I've been using the fork and would be happy to help testing PRs to get them reviewed. I don't need merge access, just saying that once @dodgyrabbit https://github.com/dodgyrabbit has merge access you can tag me on PRs to get an extra reviewer.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/timothycrosley/streamdeck-ui/issues/33#issuecomment-801429299, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7AHSJBUE7GWOR2BDO3UVTTEEH2RANCNFSM4LHNOJHA .

--

Andy Delgado 936.559.7797

[image: Apollos Development] https://www.apollos-dev.com www.apollos-dev.com

adelgado7 avatar Mar 17 '21 21:03 adelgado7

This switches focus, thus being useless when you need an active input somwhere.

In the meantime you could try this command as a workaround which saves the active window and resets it after running the hotkey that switches to your scene:

bash -c "actwin=$(xdotool getactivewindow); xdotool search --name '^OBS [0-9]+\.[0-9]+\.[0-9]+ \(linux\) - ' windowactivate --sync key ctrl+alt+1 && xdotool windowactivate $actwin"

marcomeyerVFX avatar May 02 '21 10:05 marcomeyerVFX

I created a fork where I added support for OBS using the obs-websocket plugin. This allows you to switch scenes in OBS without having to switch focus between windows since it's communicating using websockets between streamdeck-ui and OBS.

Also merged a bunch of other items in this fork, see the readme for details.

image

any update on the status of this? keep trying to find it but I have to assume it isn't available right now.

Donkula avatar Aug 07 '21 19:08 Donkula

This switches focus, thus being useless when you need an active input somwhere.

In the meantime you could try this command as a workaround which saves the active window and resets it after running the hotkey that switches to your scene:

bash -c "actwin=$(xdotool getactivewindow); xdotool search --name '^OBS [0-9]+\.[0-9]+\.[0-9]+ \(linux\) - ' windowactivate --sync key ctrl+alt+1 && xdotool windowactivate $actwin"

I use a similar method:

bash -c "w=`xdotool getactivewindow` && xdotool search --name '^OBS ' windowactivate --sync key ctrl+alt+shift+1 && xdotool windowactivate $w"

Though, I have noticed that I have to press the buttons twice to get it to do the thing. Anyone else have that issue or know how to solve it?

teklynk avatar Aug 15 '21 04:08 teklynk

I achieved this externally with obs-websockets and obs-cli (https://github.com/muesli/obs-cli), which is simpler than implementing application-specific stuff in streamdeck.

obs-cli scene switch 'My Scene'

(I had the same press twice issue with xdotool)

magicoli avatar Sep 16 '21 20:09 magicoli

I achieved this externally with obs-websockets and obs-cli (https://github.com/muesli/obs-cli), which is simpler than implementing application-specific stuff in streamdeck.

obs-cli scene switch 'My Scene'

(I had the same press twice issue with xdotool)

Hello magicoli, can you elaborate how you got the obs-cli commands to work? I have the webhook and obs-cli installed on my Ubuntu machine but unable to trigger any command (namely the scene switcher) from the streamdeck application.

ntbanks924 avatar Sep 18 '21 21:09 ntbanks924

I achieved this externally with obs-websockets and obs-cli (https://github.com/muesli/obs-cli), which is simpler than implementing application-specific stuff in streamdeck. obs-cli scene switch 'My Scene' (I had the same press twice issue with xdotool)

Hello magicoli, can you elaborate how you got the obs-cli commands to work? I have the webhook and obs-cli installed on my Ubuntu machine but unable to trigger any command (namely the scene switcher) from the streamdeck application.

Hi Nicholas

The process was pretty straight-forward for me, so I don't know if I can be of any help.

I use Ubuntu 21.04 and OBS Studio 27.0.1

I downloaded and installed websocket package from https://github.com/Palakis/obs-websocket/releases/tag/4.9.1

`dpkg -i obs-websocket_4.9.1-1_amd64.deb`

I downloaded and installed obs-cli linux package from https://github.com/muesli/obs-cli/releases (in my case obs-cli_0.2.0_linux_amd64.deb)

`dpkg -i obs-cli_0.2.0_linux_amd64.deb`

Once done, i tried a command and it worked out of the box, like

`obs-cli source list`

(with --password=websocketpassword if authentication is set in OBS > Tools > Websocket)

I didn't figure a way to store the password yet, but maybe there is one. I hope it helps

magicoli avatar Sep 18 '21 23:09 magicoli

I must have some issue in my web socket setup then. Authentication is turned off. When I enter any command in terminal for obs-cli, i get the following:

panic: idk what kinda message this is lol

goroutine 7 [running]: github.com/andreykaipov/goobs.(*Client).handleRawMessages(0x8906280, 0x8824580, 0x88245c0) github.com/andreykaipov/[email protected]/client.go:180 +0x350 github.com/andreykaipov/goobs.(*Client).handleMessages(0x8906280) github.com/andreykaipov/[email protected]/client.go:124 +0xc1 created by github.com/andreykaipov/goobs.New github.com/andreykaipov/[email protected]/client.go:72 +0x139

Thanks for the assistance though and hope I'm able to make use of this as it seems much simpler than some of the other options posted here. As I was following this project, I was certain there was discussion of merging the web socket functionality into streamdeck-ui.

Edit: I found the source of my issue. Uninstalled obs-websocket and reinstalled correct version. 5.0.X Alpha version is incompatible with OBS-CLI. Perhaps if I read things first.....

ntbanks924 avatar Sep 20 '21 19:09 ntbanks924

I created a fork where I added support for OBS using the obs-websocket plugin. This allows you to switch scenes in OBS without having to switch focus between windows since it's communicating using websockets between streamdeck-ui and OBS. Also merged a bunch of other items in this fork, see the readme for details. image

any update on the status of this? keep trying to find it but I have to assume it isn't available right now.

I downloaded your fork and Im missing the websocket option for the password, and the brightness slighter is even missing. I tried submitting the issue your own page but i wasnt able to.

using the obs-cli for the moment as per @magicoli suggested

Please see attached screenshot Screenshot from 2021-11-14 12-06-45

oparada1988 avatar Nov 14 '21 17:11 oparada1988

hi, this project seems to be stale and a new fork as been made with the intention of replacing this one.

if this still an issue please reopen it at: https://github.com/streamdeck-linux-gui/streamdeck-linux-gui

coolapso avatar Jul 27 '23 21:07 coolapso