mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 13:39:46 +01:00
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:
parent
115e76ae12
commit
6cc4fd6ede
1 changed files with 15 additions and 6 deletions
|
@ -65,12 +65,21 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# xss-lock will run specified screen locker when the session is locked via loginctl
|
systemd.user.services.xss-lock = {
|
||||||
# can't be started as a systemd service,
|
Unit = {
|
||||||
# see https://bitbucket.org/raymonad/xss-lock/issues/13/allow-operation-as-systemd-user-unit
|
Description = "xss-lock, session locker service";
|
||||||
xsession.initExtra = "${pkgs.xss-lock}/bin/xss-lock ${
|
After = [ "graphical-session-pre.target" ];
|
||||||
concatStringsSep " " cfg.xssLockExtraOptions
|
PartOf = [ "graphical-session.target" ];
|
||||||
} -- ${cfg.lockCmd} &";
|
};
|
||||||
|
|
||||||
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = concatStringsSep " "
|
||||||
|
([ "${pkgs.xss-lock}/bin/xss-lock" "-s \${XDG_SESSION_ID}" ]
|
||||||
|
++ cfg.xssLockExtraOptions ++ [ "-- ${cfg.lockCmd}" ]);
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue