Notebookforums
 
 Home 
       
 Forums 
 
 Guides 
   
Old 08-05-2009, 03:40 PM   #1
Zem Frim-Bott
i can LOSE!
 
Zem Frim-Bott's Avatar

Join Date: Jan 2005
Location: here, in my van.
Posts: 6,116
Credits: 1,540
 
Zem Frim-Bott is cool enough to have people show up to his/her party!
mp3 player issues / shell scripting help

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.
__________________
Since there is no government of which the concern or the discipline is primarily the health either of household or of the earth, since it is in the nature of any state to be concerned first of all with its own preservation and only second with the cost, the dependable, clear response to man's moral circumstance is not that of law, but that of conscience. The highest moral behavior is not obedience to law, but obedience to the informed conscience even in spite of law. -- Wendell Berry
Zem Frim-Bott is offline   Reply With Quote
Old 08-05-2009, 04:06 PM   #2
Seablade
Dont Ask
 
Seablade's Avatar

Join Date: Oct 2004
Location: Somewhere in the US
Posts: 3,592
Credits: 51,095
 
Seablade has disabled reputation
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
Seablade is offline   Reply With Quote
Old 08-05-2009, 07:52 PM   #3
Zem Frim-Bott
i can LOSE!
 
Zem Frim-Bott's Avatar

Join Date: Jan 2005
Location: here, in my van.
Posts: 6,116
Credits: 1,540
 
Zem Frim-Bott is cool enough to have people show up to his/her party!
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...
__________________
Since there is no government of which the concern or the discipline is primarily the health either of household or of the earth, since it is in the nature of any state to be concerned first of all with its own preservation and only second with the cost, the dependable, clear response to man's moral circumstance is not that of law, but that of conscience. The highest moral behavior is not obedience to law, but obedience to the informed conscience even in spite of law. -- Wendell Berry
Zem Frim-Bott is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Safari Scripting TheStu Apple Notebooks 2 11-21-2007 12:47 PM
Anyone that knows scripting, how to I adjust this to accept multi usernames? CStradling24 Dell Home (Inspiron, XPS, Studio) 2 01-13-2007 12:10 AM
MP3 Player Issues SagerGuy24 Sager 8790 Tech Support (Tech problems only) 0 05-14-2006 01:36 PM
(macromedia) flash player issues mr_et Linux Notebooks 0 01-09-2005 11:53 PM
MP3 player causing issues. Vandelay Sager 88XX Tech Support (Tech problems only) 2 08-18-2003 04:20 PM


All times are GMT -6. The time now is 10:14 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2001-2009 NotebookForums LLC