Add steam with gamescope destkop entry

This commit is contained in:
2025-08-30 19:08:01 +02:00
parent 8b702d04b2
commit 2b3fdf82fa
3 changed files with 42 additions and 0 deletions

View File

@@ -215,6 +215,12 @@ window-rule {
open-on-workspace "chat"
}
// from wiki, move steam notifications to a corner
window-rule {
match app-id="steam" title=r#"^notificationtoasts_\d+_desktop$"#
default-floating-position x=10 y=10 relative-to="bottom-right"
}
spawn-at-startup "wallpaper"
spawn-at-startup "ags"
spawn-at-startup "kitty"

View File

@@ -9,6 +9,17 @@
wineWowPackages.waylandFull
winetricks
];
programs.gamescope = {
enable = true;
capSysNice = true;
args = [
"--steam"
"--hdr-enabled"
"--adaptive-sync"
"--fullscreen"
"--expose-wayland"
];
};
hardware.steam-hardware.enable = true;
services.flatpak.enable = true;

View File

@@ -145,4 +145,29 @@ in {
StartupNotify=false
Terminal=false
'';
# override to start with gamescope
xdg.desktopEntries."com.valvesoftware.Steam.desktop" = let
start-steam = pkgs.writeShellScriptBin "start-steam" ''
CMD="flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam --file-forwarding com.valvesoftware.Steam @@u %U @@"
# gamescope doesn't detect output size
# other args are defined in programs.gamescope.args
${lib.getExe pkgs.gamescope} \
"-W" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].width')" \
"-w" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].width')" \
"-H" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].height')" \
"-h" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].height')" \
-- $CMD
'';
in {
name = "Steam (gamescope)";
comment = "Application for managing and playing games on Steam";
exec = lib.getExe start-steam;
icon = "com.valvesoftware.Steam";
terminal = false;
type = "Application";
categories = ["Network" "FileTransfer" "Game"];
mimeType = ["x-scheme-handler/steam" "x-scheme-handler/steamlink"];
};
}