A cheap alarm clock

alarm-clock-iconThis is how to build an alarm clock using the Linux at command.
It also uses the mplayer command line utility which can/must be installed.

Firstly, we need an mp3 song to be stored in a user’s directory. Let’s assume that it’s the ~/Music/Celesta.mp3 file.
Then, I’ll use the { mplayer -really-quiet ~/Music/Celesta.mp3; } & command so the song be played in the background in its own shell { } and leave space for the next command (notify-send "Wake up" "$(date +%R)\nIt's about time" -i face-wink) to display the notification.

at 21:45
warning: commands will be executed using /bin/sh
at> { mplayer -really-quiet ~/Music/Celesta.mp3; } &
at> notify-send "Wake up" "$(date +%R)\nIt's about time" -i face-wink
at> <EOT>

The <EOT> is the Ctlr-D keystroke.


REMARKS:

A list with the stock-icon-names e.g. face-wink can be found with the command: ls /usr/share/icons/gnome/32x32/emotes/

sudo pacman -S at
sudo systemctl enable atd
sudo systemctl start atd

REFERENCES:

  1. Manpage: mplayer2