diff --git a/environments/niri/niri.kdl b/environments/niri/niri.kdl index cd6d9f4..85975fd 100644 --- a/environments/niri/niri.kdl +++ b/environments/niri/niri.kdl @@ -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" diff --git a/modules/gui/default.nix b/modules/gui/default.nix index c243735..0839d40 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -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; diff --git a/modules/gui/home.nix b/modules/gui/home.nix index 7c6dac1..204e54c 100644 --- a/modules/gui/home.nix +++ b/modules/gui/home.nix @@ -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"]; + }; }