Skip to content

domainus/sunshine-bazzite-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sunshine-bazzite-script

Scripts to get a Sunshine setup running on Bazzite with a virtual display (custom EDID + headless VKMS).

Scripts

  • virtual_display_setup.sh — build and install a custom EDID RPM. Prompts for your EDID .bin, layers prerequisites if needed, patches initramfs, and appends the kernel arg.
  • virtual_display_update.sh — update the EDID RPM in place. Detects the installed edid_patch name from rpm-ostree status, prompts for a new EDID .bin, rebuilds, and reinstalls.
  • virtual_display_uninstall.sh — remove the EDID patch. Detects/removes the edid_patch RPM, deletes the dracut config, removes any drm.edid_firmware=edid/... karg, disables the custom initramfs, and reboots.
  • setup_sunshine_scripts.sh — installs the Sunshine prep/cleanup scripts to ~/.local/bin, writes global_prep_cmd to ~/.config/sunshine.conf, installs a systemd sleep hook that runs /usr/local/bin/force_display_wake.sh after resume, and drops an unlock_on_connect.sh helper that unlocks the session for user ryan via loginctl unlock-session.
  • sunshine_sleep.sh / sunshine_cancel_sleep.sh — start/stop a per-user 60s suspend timer without sudo. Called by the prep/undo scripts.
  • setup_startup_failsafe_service.sh — optional; installs a per-user systemd service that runs fix_displays.sh on login to recover if only the prep ran.
  • wake_on_lan_fix_nvidia.sh — installs a systemd resume hook (nvidia-display-wake.service) that wakes NVIDIA displays after suspend. Supports --mode=loginctl|xset|kscreen.
  • uninstall_wake_on_lan_fix_nvidia.sh — removes the nvidia-display-wake.service resume hook.
  • nvidia-resume-fix.sh — installs a KDE Wayland resume fix script at /usr/local/bin/kde-wayland-fix-resume and wires it to systemd-suspend.service via an override. Prompts for your output and mode.
  • uninstall.sh — modular uninstaller with flags for the EDID patch, Sunshine helper scripts/wake unit, streamer autologin hooks, and the failsafe service. Supports --all, --dry-run, and --target-user.
  • sunshine_tui.sh — TUI launcher that aggregates the scripts into a single menu-driven interface.

Requirements

  • Bazzite with rpm-ostree
  • Root privileges (writes to /etc, manages systemd, installs layered packages)
  • An EDID binary file to feed the scripts

Usage (EDID)

Prerequisite Steps

  1. Clone this repo.
  2. Run ujust setup-sunshine if not done already.
  3. Run for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done to find a list of GPUs' free DP or HDMI output.
  4. Edit connector names to match your hardware: in virtual_display_setup.sh replace HDMI-A-1 in the drm.edid_firmware arg with the target output, and in sunshine_do.sh/sunshine_undo.sh replace the default HDMI-A-1 connector name with the one you found in step 3.

Installation

  1. Kill the Sunshine Process
  2. Run sudo ./virtual_display_setup.sh and supply your EDID .bin path when prompted. The script builds/installs edid_patch, updates initramfs, and appends the kernel arg, then reboots. Then follow the auto-unlock step below.

NOTE: If you do not want auto-unlock then remove the following lines from sunshine_do.sh:

"${SCRIPT_DIR}/unlock_on_connect.sh"
  1. Run sudo ./setup_sunshine_scripts.sh. This installs the Sunshine prep/cleanup scripts to ~/.local/bin, writes ~/.config/sunshine.conf, installs /usr/local/bin/force_display_wake.sh plus a systemd sleep hook at /etc/systemd/system-sleep/99-force-display-wake to run it after resume, and installs ~/.local/bin/unlock_on_connect.sh plus a sudoers entry that lets loginctl unlock-session run without a password:
global_prep_cmd = [{"do":"bash -c \"${HOME}/.local/bin/sunshine_do.sh \\\"${SUNSHINE_CLIENT_WIDTH}\\\" \\\"${SUNSHINE_CLIENT_HEIGHT}\\\" \\\"${SUNSHINE_CLIENT_FPS}\\\" \\\"${SUNSHINE_CLIENT_HDR}\\\"\"","undo":"bash -c \"${HOME}/.local/bin/sunshine_undo.sh\""}]

The unlock helper targets the user session; edit setup_sunshine_scripts.sh (or the installed ~/.local/bin/unlock_on_connect.sh) if you need a different user. 3) Restart Sunshine.

Notes:

  • The sleep helper scripts do not need sudo. They use per-user state under ${XDG_RUNTIME_DIR:-/tmp} and loginctl/systemctl to suspend.
  • If you run them directly from the repo, ensure they are executable (chmod +x sunshine_sleep.sh sunshine_cancel_sleep.sh). The setup script handles this for the installed copies.
  • If you hit Wake on LAN issues on NVIDIA, try: sudo rpm-ostree kargs --append-if-missing=nvidia.NVreg_PreserveVideoMemoryAllocations=1 sudo rpm-ostree kargs --append-if-missing=nvidia-drm.modeset=1 sudo rpm-ostree kargs --append-if-missing=nvidia.NVreg_EnableGpuFirmware=0. Also try sudo tee /etc/dracut.conf.d/99-edid.conf >/dev/null <<'EOF' install_items+=" /usr/lib/firmware/edid/[edidname].bin " EOF

KDE Wayland Resume Fix (NVIDIA)

  1. Run sudo ./nvidia-resume-fix.sh and enter your output (e.g. DP-3) and mode (e.g. 2560x1440@165).
  2. This installs /usr/local/bin/kde-wayland-fix-resume, creates /etc/systemd/system/systemd-suspend.service.d/override.conf with ExecStartPost=/usr/local/bin/kde-wayland-fix-resume, and reloads systemd.

Optional but HIGHLY RECOMMENDED

Run setup_startup_failsafe_service.sh. This makes it to where it runs the sunshine_undo.sh script on startup in the event that when connecting to Sunshine only te sunshine_do.sh script runs. This can help fix black screens after logging in. (Ask me how I know :] )

Update edid_patch

  1. To swap to a new EDID later, run sudo ./virtual_display_update.sh, provide the new .bin, and reboot when prompted.

Uninstall

  1. For a modular cleanup (EDID patch, helper scripts/wake unit, autologin hooks, failsafe), run sudo ./uninstall.sh --all or pick flags (--virtual-display, --sunshine-scripts, --streamer-autologin, --failsafe-service). Use --dry-run to preview actions.
  2. Reboot

Example EDID

The provided example_edid.bin supports various resolutions including 4K@60, 2420x1668@120Hz (iPad Pro), and 1280x800@90Hz, among other common resolutions.

Custom EDIDs

It is recommended to use the samsung-q800t-hdmi2.1 EDID from v4l-utils. Use Custom Resolution Utility (CRU) to add more resolutions to the base EDID and export. CRU works fine under Wine.

Default Steam Launch Commands

LD_PRELOAD="" PROTON_HIDE_NVIDIA_GPU=0 PROTON_ENABLE_NVAPI=1 gamescope -f -b -H $(kscreen-doctor -j | jq '.screen.currentSize.height') --hdr-enabled --adaptive-sync -- %command%

Steam Big Picture Lag Fix

From /u/psirrow:

If you're still having the problem (or for anyone else who finds this post), I had the same issue but I solved it by ticking a few more settings. This is what I have:

in "Settings/Display" I have:

    "Disable GPU Blocklist" on

in "Settings/Interface" I have:

    "Enable smooth scrolling in web views" on (may not be necessary)

    "Enable GPU accelerated rendering in web views" on

    "Enable hardware video decoding, if supported" on

Auto Unlock when connecting to Sunshine ONLY

setup_sunshine_scripts.sh now installs ~/.local/bin/unlock_on_connect.sh, which finds the active session for user ryan and runs loginctl unlock-session <id> using a sudoers drop-in (/etc/sudoers.d/sunshine-loginctl). Run the setup script with sudo so it can write the sudoers file. If your Sunshine user is not ryan, change the username in the script (or the installed unlock helper) before running it.

Credits

https://www.reddit.com/r/Bazzite/comments/1gajkpg/add_a_custom_resolution/
/u/Acru_Jovian
https://gist.github.com/iamthenuggetman/6d0884954653940596d463a48b2f459c
https://www.azdanov.dev/articles/2025/how-to-create-a-virtual-display-for-sunshine-on-arch-linux https://www.reddit.com/r/linux_gaming/comments/1h2o0re/comment/mtq730l/ https://forums.linuxmint.com/viewtopic.php?t=440657&start=20

About

Sunshine on Bazzite with virtual displays

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages