This is a set of systemd timers and services that ensures that computer goes to bed at night (00:00-07:00), hopefully helping me to go to bed as well.
dmytrish-sleep.timer
starts sending desktop notifications about
computer going to sleep 1 minute before the night start and then
suspends the computer. Then it tries to ensure that computer sleeps
during the night time: it puts computer back to sleep in a loop until
the morning time.
Files:
/etc/systemd/system/dmytrish-sleep.timer
/etc/systemd/system/dmytrish-sleep.service
/usr/local/sbin/dmytrish-sleep.py
Enable it:
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now dmytrish-sleep.timer