NotebookForums.com › Forums › General Notebook Discussions › Linux & Other OS's › mp3 player issues / shell scripting help
New Posts  All Forums:Forum Nav:

mp3 player issues / shell scripting help

post #1 of 3
Thread Starter 
i have an iriver t10 mp3 player that i'm having a minor issue with - if i copy a folder to the device, the songs will not be written in correct order. however, they are always in the same disorder - the same order that find -name '*.mp3' returns them in. since it's always the same order, i imagine it must be ordered according to some guidelines, but i can't discern them (can anyone enlighten me?).

in any case, i've figured out that find * -name '*.mp3' -exec cp {} /whereiwantitcopied/ \; will copy the mp3 files in the current directory (and subdirectories) to the specified destination (/media/disk/MUSIC/ for my t10), and do it so they are properly ordered. a giant step in the right direction, but still short of ideal.

however, what i would like to do is make a context menu entry, so i can right click on a folder (album) and copy the mp3 files in that folder to an identically named folder on my mp3 player (the new directory being a subdirectory of /media/disk/MUSIC/). unfortunately, i'm lost. i've no idea how to read the name of the directory being clicked on, and i'm unsure of if what i want is doable in a 1 line command, or if i need a script to accomplish it.

i'd also like to try and figure as much of this out on my own as possible, so hints are preferred to answers, if that makes any sense. of course, answers are preferred to nothing

thanks in advance.
post #2 of 3
What do you mean by "They are copied in the wrong order" Do you mean the MP3 player then displays the files in the same order as the find command? In which case I personally think the MP3 player needs some work if it can't order things alphabetically on its screen, or by MP3 tags.

That being said, if that is the case, I would look at using ls instead of find as it is easier to order things. Of course you can use find and a couple of other commands to do the same thing, I just find ls a bit easier.

And of course all this being said, if you are looking to do something with a GUI, I think you are much better off using something else other than Bash. I am not even sure GUIs beyond maybe basic curses are possible in BASH, though I haven't looked at it. But the moment you add a GUI into the mix you increase complexity by a large amount. If what you are trying to do is create a GUI, I would personally look at scripting the entire thing in Python myself, as there are extensions for both Qt and Gtk for Python, and it is a fairly quick language to work in.

Seablade
post #3 of 3
Thread Starter 
yes, the mp3 player displays the tracks in the same order as the find results (sans *). it's old and stupid, apparently. i'm also cheap

i'm not actually looking to create a gui - i'm simply adding a custom action to thunar's context menu.

i just now looked at the only current entry in thunar's custom action context menu (open terminal here), and found something that might actually solve my problem.

if that doesn't work, i'll try and learn me some python. either way, thanks...
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux & Other OS's
NotebookForums.com › Forums › General Notebook Discussions › Linux & Other OS's › mp3 player issues / shell scripting help