mirror of
https://github.com/zoriya/flake.git
synced 2025-12-06 06:36:19 +00:00
Add steam with gamescope destkop entry
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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"];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user