LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-08-2005, 05:02 PM   #1
64 Bit Headache
LQ Newbie
 
Registered: Oct 2004
Location: Oklahoma State University
Distribution: SuSE 9.1(x86_64)
Posts: 12

Rep: Reputation: 0
Useful xmms script


In spite of its simplicity, this is by far the most useful thing I have ever written. It was particularly so when I had 20+ GB of music prior to a Maxtor SATA drive crash. I am hoping someone else can take some use out of it, and possibly offer improvements; as will soon be apparent, I am not that great at scripting. It runs the same search three times for three different reasons (did not know of a more efficient way to do it), so if you do have a good deal of music, it might take a couple of seconds the first time it runs, but should be nearly instantaneous after the search is in RAM.

You just invoke the script with one or two strings, it searches your music collection, displays a list of matches, and prompts if you wish to add them to your active playlist.

Code:
#!/bin/bash
export MUSIC_DIR=~/music
yorn()
{
        echo -n " [y/n] "
        read YN junk
        if [ "$YN" = "y" ]
        then
                return 0;
        else
                return -1;
        fi
}

echo
find $MUSIC_DIR | grep -i "$1" | grep -i "$2" | grep mp3
echo; echo -n "Enqueue these "; find $MUSIC_DIR | grep -i "$1" | grep -i "$2" | grep mp3 | wc -l; echo "songs?"; echo
if yorn; then
find  $MUSIC_DIR -printf "xmms -e "\"%p\"'  ''\\ \n' | grep mp3 | grep -i "$1" | grep -i "$2" | /bin/bash
# xmms -p
fi

Last edited by 64 Bit Headache; 06-08-2005 at 05:04 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xmms-infopipe can't find xmms.. minm Linux - Software 9 10-18-2004 10:00 PM
Why does every ./configure script i run fail to recognise XMMS IS INSTALLED!! theMonkeY Linux - Software 4 08-23-2004 09:18 AM
ALSA w/ XMMS : No PCM control in xmms Astro Slackware 1 08-08-2004 11:19 PM
Xmms Plugin 1.2.8 [xmms-config problem] MDMA Mandriva 2 01-29-2004 09:55 AM
red hat 9 xmms and nvidia driver-xmms ronss Red Hat 3 09-26-2003 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration