22 lines
561 B
Nix
22 lines
561 B
Nix
|
|
{ pkgs, ... }:{
|
||
|
|
home.packages = with pkgs; [
|
||
|
|
xidlehook
|
||
|
|
betterlockscreen
|
||
|
|
];
|
||
|
|
|
||
|
|
systemd.user.services.xidlehook = {
|
||
|
|
Unit.Description = "Idle: lock at 5min, suspend at ~8min";
|
||
|
|
Service = {
|
||
|
|
ExecStart = ''
|
||
|
|
${pkgs.xidlehook}/bin/xidlehook \
|
||
|
|
--detect-sleep \
|
||
|
|
--not-when-fullscreen \
|
||
|
|
--timer 300 "${pkgs.betterlockscreen}/bin/betterlockscreen -l dim" "" \
|
||
|
|
--timer 500 "systemctl suspend" ""
|
||
|
|
'';
|
||
|
|
Restart = "always";
|
||
|
|
};
|
||
|
|
Install.WantedBy = ["graphical-session.target"];
|
||
|
|
};
|
||
|
|
}
|