2008年11月17日 星期一

crontab + rhythmbox 定时播放音乐

直接用 rhythmbox 是不行的,因为需要图形,cron 仅设置了少数几个变量。

# 每天7点整运行,设置显示设备,启动 rhythmbox, 等待加载完成,开始播放
0 7 * * 1-5 export DISPLAY=:0 && rhythmbox-client && sleep 3 && rhythmbox-client --play

0 评论: