screen-locker: made xss-lock a systemd service.

Takes advantage of the new `--session` xss-lock parameter to allow
xss-lock be made into a systemd service.

PR #1015
This commit is contained in:
Gregory C. Oakes 2020-02-01 10:17:58 -08:00 committed by Robert Helgesson
parent 115e76ae12
commit 6cc4fd6ede
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -65,12 +65,21 @@ in {
};
};
# xss-lock will run specified screen locker when the session is locked via loginctl
# can't be started as a systemd service,
# see https://bitbucket.org/raymonad/xss-lock/issues/13/allow-operation-as-systemd-user-unit
xsession.initExtra = "${pkgs.xss-lock}/bin/xss-lock ${
concatStringsSep " " cfg.xssLockExtraOptions
} -- ${cfg.lockCmd} &";
systemd.user.services.xss-lock = {
Unit = {
Description = "xss-lock, session locker service";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = concatStringsSep " "
([ "${pkgs.xss-lock}/bin/xss-lock" "-s \${XDG_SESSION_ID}" ]
++ cfg.xssLockExtraOptions ++ [ "-- ${cfg.lockCmd}" ]);
};
};
};
}