It would be nice to have an alarm clock by default.
There exists a very basic user script: https://git.sr.ht/~anjan/sxmo-userscripts/tree/master/item/alarm.sh
It would be nice to have a slightly more convenient way to set up and modify an alarm. Perhaps using dmenu to set time and modify it? Problem is that the common functionality quickly becomes complex enough to warrant a small application.
I think it would be nice if it could:
It's Unix, you can just do
sleep 12h && aplay /dev/urandom
Just did a quick search and found these: https://github.com/jahendrie/shalarm https://github.com/mkscrg/alarm-clock
I gave a shot at this, here's my design:
the alarm list is the crontab (no other disc writes)
an alarm cron entry is of this form (
<script> <action> <message> <uid>
):25 7 * * 1-5 sxmo_rtcwake.sh /home/user/.local/bin/alarm.sh repeat 'Wake Up!' xesEsQRV
alarm.sh has those subcommands:
ring <message>
: ring the alarm, open a menu to either stop or snoozeonce <message> <uid>
: remove the cron entry (found by uid) and call ringadd <crontime> <message> <action ("once" or "repeat")>
: add a cron tasklist
: list registered alarmsdisable <uid>
: disable an alarm (comment the line in the crontab)enable <uid>
: enable an alarm (uncomment in the crontab)remove <uid>
: remove the crontab entryrepeat <message> <uid>
: ignore the uid and callring <message>
Targets the crontab tasks, the uid has no use in the command but identifies the line in the list for managment purpose (enable/disable/remove...)snooze <message> <uid>
: an alias of once, used to differenciate snozed alarm from user-set "once" alarms in the list
- set-alarm.sh UI script:
- main menu is a list (mnc-ordered) of existing alarms (with a toggle icon to show enabled status) and a
Add
entryAdd
asks for a time (HH:MM or crontab-style),once
orrepeat
, and a message- choosing an alarm in the main menu opens an edit menu to enable/disable/remove/edit time or message)
I use working code implementing much of this design (I'm tweaking the Edit UI at the moment). It's probably not clean enough, but I may send a patch soon.
Very cool. We have an alarm script in userscripts too now.