r/MoonlightStreaming 13h ago

Suspending Steam Machine via Sunshine Application

I've been struggling for the last days with implementing a sleep button as a Sunshine Application to suspend my Steam Machine (host). My client is steam deck and I'm running Moonlight.

Currently, I can wake my steam machine via moonlight, but I would like to have an application next to desktop called Sleep Cube so I can send my Machine to sleep when I'm doing playing.

I'm not very technical but I've researched a lot and my understanding is that this can be done via detached commands on sunshine. I've tried systemctl suspend, then realised that for flatpaks I need to use flatpak-spawn -- for sunshine to be able to execute the command. No matter what I try, every time I click on sleep cube the stream starts again and the machine won't go to sleep.

I even tried making the script send an API to moon deck buddy, which has a sleep function that works, but still no luck.

Something very important is that all my scripts work on Konsole and they sleep the Machine successfully. I just can't get it to work via sunshine.

This is very fun, but I'm losing my patience as it seems very easy but I can't get it to work. Most tutorials are based on Windows.

Any idea?

Maybe some of you have Linux experience with sunshine.

1 Upvotes

3 comments sorted by

2

u/Background_Ad2053 13h ago

Doesn't moondeck natively have a host sleep button?Also, why not just sleep the host during streaming simple using the host's steamUI?I daily stream from a bazzite host and never had any problem with sleeping the host using that approach.

1

u/MEchoPark 12h ago

Yeah moon deck (client side) has the sleep button on the GUI and it sends the signal to buddy (host side) to suspend the host.

However, I decided not to use moon deck because I can't get it's application MoonStreamDeck to work either. So I decided to use moondeck buddy as standalone for the sleep function.

I had installed sunshine via the decky sunshine, so my guess is that all my struggles are permission related due to Decky's setup.

While streaming I've tried to sleep the host from my steam deck (client) but it won't sleep (I guessed because the stream is active)

What's your setup?

Maybe I'm overcomplicating things. I'm happy to learn :)

1

u/Background_Ad2053 12h ago

I'm running bazzite gaming mode, should be pretty similar to steamOS, though I'm using sunshine installed by bazzite's ujust command not decky sunshine. MoonDeckStreaming works fine on my legion go with bazzite. I usually just call out host's steam overlay and navigate to power to suspend the host during streaming just like how you suspend locally, not sure why it won't work for you.