Fix sleep-nag
This commit is contained in:
parent
a2eb193959
commit
4c9e1d882b
1 changed files with 7 additions and 5 deletions
|
@ -16,11 +16,13 @@ let
|
||||||
time <- getZonedTime
|
time <- getZonedTime
|
||||||
let tod = localTimeOfDay . zonedTimeToLocalTime$ time
|
let tod = localTimeOfDay . zonedTimeToLocalTime$ time
|
||||||
hour = todHour tod
|
hour = todHour tod
|
||||||
|
minute = todMinute tod
|
||||||
|
evening = hour == 0
|
||||||
night = (hour < 6 && hour >= 1)
|
night = (hour < 6 && hour >= 1)
|
||||||
if night then do {
|
action
|
||||||
notify_send ([i|Es ist #{formatTime defaultTimeLocale "%H:%M" time} Uhr: Zeit ins Bett zu gehen!|]::String) "Du kannst das hier auch morgen tun!";
|
| evening = notify_send "Shutdown alert!" ([i|Rechner fährt in #{59-minute} Minuten runter.|]::String)
|
||||||
threadDelay 600000000}
|
| night = exe "/run/current-system/sw/bin/sudo" "systemctl" "shutdown"
|
||||||
else
|
action
|
||||||
threadDelay 600000000
|
threadDelay 600000000
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue