2. Log in as the user then type crontab -e for editing his cron entry
# dom = Day of Month
# dow = Day of Week
# m h dom mon dow command
42 07 * * 1-5 /usr/local/bin/alarm
3. vi /usr/local/bin/alarm
# run xterm to execute mplayer in another window
# with the parameter, display 0 you can quit playing easily,
# the parameter -loop 0 means repeat forever.
/usr/bin/xterm -display :0 -bg black -fg white \
-e /usr/local/mplayer -loop 0 filename.mp3
/usr/bin/mplayer -loop 0 filename.mp3
4. Remember to give permission of execution to alarm
chmod 7xx alarm
5. An easy way to stop playing, use the command pkill
pkill mplayer
沒有留言:
張貼留言