Skip to content

Commit b2ed4f6

Browse files
committed
fix(hyprland): fix steam startup issue
Switch to service to resolve issue with systemd slice not working all of a sudden.
1 parent 05786f9 commit b2ed4f6

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

  • modules/home/programs/graphical/wms/hyprland

modules/home/programs/graphical/wms/hyprland/apps.nix

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
config,
33
lib,
4+
pkgs,
45

56
osConfig ? { },
67
...
78
}:
89
let
9-
inherit (lib) mkIf getExe;
10+
inherit (lib) mkIf getExe getExe';
1011

1112
cfg = config.khanelinix.programs.graphical.wms.hyprland;
1213
in
@@ -72,9 +73,6 @@ in
7273
# ++ lib.optionals config.programs.vesktop.enable [
7374
# (mkStartCommand { slice = "b"; } "${getExe config.programs.vesktop.package}")
7475
# ]
75-
++ lib.optionals (osConfig.programs.steam.enable or false) [
76-
(mkStartCommand { slice = "b"; } "steam")
77-
]
7876
++ lib.optionals config.khanelinix.suites.social.enable [
7977
(mkStartCommand { slice = "b"; } "element-desktop")
8078
]
@@ -101,5 +99,26 @@ in
10199
lib.mkBefore (
102100
if (osConfig.programs.uwsm.enable or false) then [ "uwsm finalize" ] ++ appCommands else appCommands
103101
);
102+
103+
systemd.user.services.hyprland-start-steam = mkIf (osConfig.programs.steam.enable or false) {
104+
Unit = {
105+
Description = "Start Steam after Hyprland session";
106+
After = [ "graphical-session.target" ];
107+
PartOf = [ "graphical-session.target" ];
108+
ConditionEnvironment = "WAYLAND_DISPLAY";
109+
};
110+
111+
Install.WantedBy = [ "graphical-session.target" ];
112+
113+
Service = {
114+
Type = "oneshot";
115+
ExecStartPre = "${getExe' pkgs.coreutils "sleep"} 5";
116+
ExecStart =
117+
if (osConfig.programs.uwsm.enable or false) then
118+
"${getExe pkgs.uwsm} app -s b -a steam -p TimeoutStopSec=10s -- steam"
119+
else
120+
"steam";
121+
};
122+
};
104123
};
105124
}

0 commit comments

Comments
 (0)