fix(sunshine): automatically set screen resolution for sunshine

This commit is contained in:
2026-02-24 02:02:59 +01:00
parent 7223b63fca
commit efa9be4314
2 changed files with 16 additions and 9 deletions

View File

@@ -21,38 +21,47 @@ in {
system_tray = "enabled"; system_tray = "enabled";
output_name = 1; output_name = 1;
}; };
applications.apps = [ applications.apps = let
defaultPrep = [
{
do = "sh -c \"hyprctl -i 0 keyword monitor \\\"DP-2,\${SUNSHINE_CLIENT_WIDTH}x\${SUNSHINE_CLIENT_HEIGHT}@\${SUNSHINE_CLIENT_FPS},0x0,1\\\"\"";
undo = "sh -c \"hyprctl -i 0 keyword monitor 'DP-2,2560x1080@60,0x0,1,transform,1'\"";
}
];
in [
{ {
name = "Desktop"; name = "Desktop";
image-path = "desktop.png"; image-path = "desktop.png";
prep-cmd = defaultPrep;
} }
{ {
name = "Low Res Desktop"; name = "Low Res Desktop";
image-path = "desktop.png"; image-path = "desktop.png";
prep-cmd = defaultPrep;
} }
{ {
name = "Steam Big Picture"; name = "Steam Big Picture";
detached = ["setsid steam steam://open/bigpicture"]; detached = ["setsid steam steam://open/bigpicture"];
prep-cmd = { prep-cmd = defaultPrep;
do = "";
undo = "setsid steam steam://close/bigpicture";
};
image-path = "steam.png"; image-path = "steam.png";
} }
{ {
name = "OpenTTD"; name = "OpenTTD";
cmd = "openttd"; cmd = "openttd";
image-path = "/home/phundrak/.config/sunshine/covers/igdb_18074.png"; image-path = "/home/phundrak/.config/sunshine/covers/igdb_18074.png";
prep-cmd = defaultPrep;
} }
{ {
name = "OpenMW"; name = "OpenMW";
cmd = "openmw"; cmd = "openmw";
image-path = "/home/phundrak/.config/sunshine/covers/igdb_24775.png"; image-path = "/home/phundrak/.config/sunshine/covers/igdb_24775.png";
prep-cmd = defaultPrep;
} }
{ {
name = "Vintage Story"; name = "Vintage Story";
cmd = "flatpak run at.vintagestory.VintageStory"; cmd = "flatpak run at.vintagestory.VintageStory";
image-path = "/home/phundrak/.config/sunshine/covers/igdb_69547.png"; image-path = "/home/phundrak/.config/sunshine/covers/igdb_69547.png";
prep-cmd = defaultPrep;
} }
]; ];
}; };

View File

@@ -62,10 +62,8 @@ in {
monitor = monitor =
{ {
"marpa" = [ "marpa" = [
# "DP-1, 3440x1440@144, 1080x550, 1" "DP-1, 3440x1440@144, 1080x550, 1"
# "DP-2, 2560x1080@60, 0x0, 1, transform, 1" "DP-2, 2560x1080@60, 0x0, 1, transform, 1"
"DP-2, 1366x768@60, 0x0, 1"
# "DP-2, 1829x1143@60, 0x0, 1"
]; ];
"gampo" = []; "gampo" = [];
}."${cfg.host}"; }."${cfg.host}";