diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix index eb31bec..9dd3601 100644 --- a/modules/greetd/default.nix +++ b/modules/greetd/default.nix @@ -5,12 +5,24 @@ }: with lib; let cfg = config.eboskma.greetd; + steamCfg = config.programs.steam; - style = builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString ../../home-manager/modules/sway/wallpapers/river-2560.png) ] (builtins.readFile ./greetd.css); + # style = builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString ../../home-manager/modules/sway/wallpapers/river-2560.png) ] (builtins.readFile ./greetd.css); + wallpaper = ../../home-manager/modules/sway/wallpapers/river-2560.png; + style = builtins.readFile ./greetd.css; swaySession = pkgs.writeShellScript "sway-session" '' ${pkgs.sway}/bin/sway --unsupported-gpu ''; + + steam-gamescope = + let + exports = builtins.attrValues (builtins.mapAttrs (n: v: "export ${n}=${v}") steamCfg.gamescopeSession.env); + in + pkgs.writeShellScriptBin "steam-gamescope" '' + ${builtins.concatStringsSep "\n" exports} + gamescope --steam ${toString steamCfg.gamescopeSession.args} -- steam -tenfoot -pipewire-dmabuf + ''; in { options.eboskma.greetd = { @@ -33,7 +45,7 @@ in }; programs.regreet = { - enable = true; + enable = false; settings = { background = { path = ../../home-manager/modules/sway/wallpapers/river-2560.png; @@ -58,7 +70,7 @@ in security.pam.services.greetd.u2fAuth = false; - # exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -s /etc/greetd/gtkgreet.css; swaymsg exit" + # exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit" networking.firewall.allowedTCPPorts = lib.mkIf cfg.wayvnc [ 5900 ]; @@ -70,7 +82,7 @@ in ((lib.optional cfg.wayvnc "exec ${pkgs.wayvnc}/bin/wayvnc -g 0.0.0.0") ++ [ '' - exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit" + exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -s /etc/greetd/gtkgreet.css -b ${wallpaper}; swaymsg exit" include /etc/sway/config.d/* '' ]); @@ -79,7 +91,10 @@ in }; "greetd/environments" = { text = concatStringsSep "\n" ((optional cfg.sway "${swaySession}") - ++ [ "${pkgs.bash}/bin/bash" ]); + ++ [ + (toString steam-gamescope) + "${pkgs.bash}/bin/bash" + ]); user = "greeter"; group = "greeter"; }; diff --git a/modules/greetd/greetd.css b/modules/greetd/greetd.css index 691f903..9d464c9 100644 --- a/modules/greetd/greetd.css +++ b/modules/greetd/greetd.css @@ -1,5 +1,4 @@ window { - background-image: url("file://{WALLPAPER}"); background-size: cover; background-position: center; }