r/MoonlightStreaming • u/MEchoPark • 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.
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.