OESF Portables Forum
Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Angstrom & OpenZaurus => Topic started by: dino on December 08, 2004, 06:00:43 pm
-
Xmms will play in the random song selection mode if you click on the icon that looks like the equalizer bar.
I have a cron job that launches xmms in the mornings, but don't know how to get xmms to come up in the random mode. It does not seem to be saving the settings. Can this be switched on via the command line?
For those of you trying to get cron to launch xmms heres a tip.
Open up a shell and type export to get a list of all your environment variables:
root@collie:~/.xmms# export
export HOME='/root'
export LOGNAME='root'
export PATH='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin::/opt/QtPalmtop/bin'
export PS1='\u@\h:\w\$ '
export PWD='/root'
Copy the variables to your crontab and remove the word "export":
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.24098 installed on Wed Dec 8 15:53:28 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#Environmental Variables
HOME='/root'
LOGNAME='root'
PATH='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin::/opt/QtPalmtop/bin'
PS1='\u@\h:\w\$ '
PWD='/root'
QTDIR='/opt/QtPalmtop'
SHELL='/bin/sh'
TERM='linux'
TERMINFO='/mnt/card/etc/terminfo'
TSLIB_TSDEVICE='/dev/ts'
TSLIB_TSEVENTTYPE='COLLIE'
USER='root'
#Cron jobs
20 06 * * 1-5 xmms -p
-
um... I have a way to accomplish the same thing....
create a script called shuffle.awk and set it chmod +x:
#!/usr/bin/awk
# AWK Shuffle from Carlos J. G. Duarte on Deja News
BEGIN { srand() }
{ while (x[sprintf("%6f%s", rand(), $0)]++){} }
END { for (i in x) print substr(i, 9) }
Then you can call it using:
cat ~/.xmms/xmms.m3u | grep -v EXTINF | grep -v EXTM3U | awk -f shuffle.awk > ~/.xmms/xmms.m3u
do that before you start xmms (either by putting it in the same line of the cron job, running it a minute before xmms or wrapping into into another script)...
Cheers....
-G
-
ironstorm,
Works great!
I put the #!/bin/sh
cat ~/.xmms/xmms.m3u | grep -v EXTINF | grep -v EXTM3U | awk -f /usr/bin/shuffle.awk > ~/.xmms/xmms.m3u
in a script called "xmmsshuffle.sh"
my cron job is 20 06 * * 1-5 xmmsshuffle.sh && xmms -p
for a wakeup at 06:20 on weekdays. Notice I had to use the complete path to shuffle.awk to use it from cron.
People ask "Why do you run Linux?" For one reason, it seems there is always a way to make it do what you want.
Thanks,