u/Background_Ad2053

Created some scripts that auto suspend/resume games upon streaming ending/resuming for bazzite gamemode streaming

Been using BazziteOS gamemode streaming for about a year now. After nailed down the virtual display and adaptive resolution which works similar to Windows Sunshine forks with virtual display a few months ago, I fully switched my gaming PCs to Bazzite. While you can easily do in-game sleep and WOL to seamlessly go back where you left just like a steamdeck with such setup, the whole waking up process takes around 10s which is not ideal if you need to frequently pause during gaming.

So I use a dekcy plugin called "PauseGames" to do the job, deck owners might be familar with this one, it basically freezes the game so that it doesn't consume CPU/GPU resources and only takes up RAM space once frozen. Freezing a game is super easy, you just need to toggle on the "pause on steam overlay" option and press steam(xbox) button or any hot-key you assigned to call out the steam overlay.

A few days ago, finally got annoyed having to manually do this everytime I quit/resume the streaming, so I vibecoded some scripts to automatically do such "button pressing" for me. The idea is simple, use a tool called "ydotool" which is already included in bazzite (although not activated by default, had to create a service for it) to emulate pressing the hot-key bringing up steam overlay, so that the pausegames plugin can be triggered. The streaming status change is detected by monitoring the sunshine logs so that the ydotool presses the buttons upon streaming ending/resuming, a service is also created for this script to keep it running in background and persistent after reboot.

So far it seems to be working well for me, a fully one button pause/resume console-like streaming experience. The host in video is a bazzite Unraid virtual machine with a 6750xt passthroughed, handheld is konkor fit pocket 8gen3 version.

u/Background_Ad2053 — 4 days ago