You are not logged in.
Pages: 1
I've got this little script that continuously plays random songs:
#!/bin/sh
songs=(~/music/*/*/*)
total=${#songs[@]}
while true
do
song=${songs[$RANDOM%$total]}
oggdec "$song" -o- | aplay -q
done
I'd like to be able to skip a song and go to the next, aside from a ctrl-c and restart. Suggestions?
Last edited by Odysseus (2009-11-21 09:04:09)
I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.
Offline
If the script isn't to be run in background then may be you can keep the while loop in background, and use read to get a response,e.g. if it is "n" then terminate the while loop and restart with array index increased by 1
But if you'd like to run it in the background, you can use trapping of signals may be
Last edited by djszapi (2009-11-21 17:36:38)
Offline
Ehh, I think I'm gonna go all out with something written in python using gstreamer and gtk...I'd love to be able to use my media keys
Last edited by Odysseus (2009-11-22 19:15:59)
I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.
Offline
Pages: 1