Feature: Add compatibility for kotor

This commit is contained in:
2026-10-22 06:41:45 +01:00
parent e8113f4366
commit 16a0d12b8f
2 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
#!/bin/sh
# Sunshine global_prep_cmd: make games launched during a stream open on the
# headless stream output instead of whichever physical monitor had focus.
# start -> enable the "sunshine-games" Hyprland window rule (layout/windowrules.lua:
# steam_app_* -> workspace 9 on HEADLESS-1, fullscreen) and make
# HEADLESS-1 the XWayland primary output, which Wine/Proton uses for
# fullscreen mode changes and scaling
# stop -> disable the rule and clear the primary output again
# Games that pick their render size at launch (KOTOR etc.) otherwise come up
# on a desk monitor and stay tiny in a corner when moved to the stream.
case "$1" in
start)
hyprctl eval 'SunshineGamesRule:set_enabled(true)'
xrandr --output HEADLESS-1 --primary 2>/dev/null
;;
stop)
hyprctl eval 'SunshineGamesRule:set_enabled(false)'
xrandr --noprimary 2>/dev/null
;;
*)
echo "Usage: $0 start|stop" >&2
exit 1
;;
esac
exit 0

View File

@@ -2,4 +2,4 @@ audio_sink = sink-sunshine-stereo
csrf_allowed_origins = https://xol.twhomelab.local:47990 csrf_allowed_origins = https://xol.twhomelab.local:47990
nvenc_preset = 4 nvenc_preset = 4
output_name = HEADLESS-1 output_name = HEADLESS-1
global_prep_cmd = [{"do":"/home/thomas/.config/hypr/scripts/SunshineIdle.sh start","undo":"/home/thomas/.config/hypr/scripts/SunshineIdle.sh stop"}] global_prep_cmd = [{"do":"/home/thomas/.config/hypr/scripts/SunshineIdle.sh start","undo":"/home/thomas/.config/hypr/scripts/SunshineIdle.sh stop"},{"do":"/home/thomas/.config/sunshine/scripts/sunshine-games.sh start","undo":"/home/thomas/.config/sunshine/scripts/sunshine-games.sh stop"}]