I only found
one GUI alarm/timer in portage and it wasnâ€™t exactly what I was looking
for (see wmtimer below) so I decided just to use cron.
Cron is a good solution for an alarm – itâ€™s running all the time and
simple to setup. Once I learned to use it, I use it all the time.
The crontab application is used to work with cron jobs. The cron
daemon checks for cronjobs every minute. A command line mp3 player can
be used here but I use Audacious. Cron will need to be told what X
display to use for Audacious to play. Discover the current display by:
env | grep DISPLAY
Then as regular user edit crontab.
Hereâ€™s a simple comment to represent the cronjob layout:
# minute (0-59),
# | hour (0-23),
# | | day of the month (1-31),
# | | | month of the year (1-12),
# | | | | day of the week (0-6 with 0=Sunday).
# | | | | | commands
Enter the time (multiple times, days need to be separated with
commas) and script to execute for the alarm. The asterik can be used
(*) to satisfy all variables. Hereâ€™s mine for audacious:
07 21 * * 1,2,3,4,5 env DISPLAY=:0.0 audacious /home/user/My\ Music/Other/Alarms/301gq.mp3
I found some good alarm tracks at this site the were perfect for the task.
I like vim as my system editor but any can be used. In Gentoo edit the
/etc/rc.conf to change it. To list the crontab.
Wmtimer works just fine for Gnome users (KDE has kalarm) it leaves a
small window on the screen which canâ€™t be hidden but it is able use the
system beep or execute a command on an alarm/timer event. Starting it
from the command line is pretty easy:
wmtimer -a -t 18:39:00 -e "mpg321 ~/Music/Other/Alarms/301gq.wav"
Update:Audacious also has alarm ability but itâ€™s
buried deep in itâ€™s preferences ( Preferences > Plugins > General
), I find using cron better.