1
0
Fork 0

Improve sleep-nag timer

This commit is contained in:
Malte Brandy 2021-07-12 01:02:55 +02:00
parent 61365b11ad
commit 7db0487921
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -12,6 +12,8 @@ let
];
bins = [ pkgs.libnotify pkgs.systemd ];
} ''
interval = 5
main = forever $ do
time <- getZonedTime
let tod = localTimeOfDay . zonedTimeToLocalTime$ time
@ -24,7 +26,7 @@ let
| night = systemctl "poweroff"
| otherwise = pass
action
threadDelay 600000000
threadDelay $ (interval - (minute `mod` interval)) * 60 * 1000000
'';
in
{