Regular alarm clocks have the disadvantage of not turning off your computer when it's time to sleep, they just beep when it's time to get up.
To prevent you from finishing "just this little thing" and getting to bed too late, you can set up mezamashi to shut down your computer at a specific time beforehand, e.g. in 2 hours, and to wake you up with a nice song in your media player or anything else you can steer from the command line.
But the crucial point is that it turns on your computer when it's time to get up and lets you know that - so it uses the force that keeps you at your computer and out of bed at bedtime to get you out of bed (and, unfortunately, at the computer again) when it's time to get up.
The only thing left for you is to get out of the house in time, but at least your early-morning sleapyness shouldn't make you stay in bed anymore. ;)
Commands:
Usage: mezamashi.py command [options]
Options:
-h, --help show this help message and exit
Commands:
show show the current alarm time
sleep set the time to suspend the computer
set set the alarm time.
unset unset the current alarm
Example usage:
# set a wakeup alarm to 8 o'clock
>./mezamashi.py set 8:00
# show the current alarm
>./mezamashi.py show
# disable the current alarm
>./mezamashi.py unset
# set a wakeup alarm in 7 hours and a half
>./mezamashi.py set 7h30
# go to sleep in 20 minutes. you need to use this command to suspend to run your alarm_shcommand at next startup.
>./mezamashi.py sleep 0h20
# there's an alias if you want to suspend immediatly
>./mezamashi.py sleep now
mezamashi expects rtcwake and sudo to be installed on the system, and needs you to set your alarm command in the config file at ~/.config/mezamashi.conf. This file will be autogenerated on first run if it doesn't already exist.
What gets used for suspend (systemctl by default) and whether your hardware clock is kept in local time or utc (local time by default) can be configured in the config file.
The latter is the case if this command returns your local time:
sudo hwclock --show --localtime
mezamashi uses the scriptine python module for command parsing and execution, make sure it's installed with
sudo pip install scriptine
or
sudo easy_install scriptine
mezamashi is licensed under the General Public License version 3, the text of which can be found in LICENSE, or any later version of the GPL, unless otherwise noted.
Licensing of used libraries:
- python: PSFL
- scriptine: MIT
mezamashi is written by Florian Jacob.
mezamashi is the japanese word for alarm clock. 'wecker', the german word, was already taken, so I chose mezamashi to make me remember a vocable without doing anything for it. ;)