LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   manipulate dcop data for File commandS? (https://www.linuxquestions.org/questions/programming-9/manipulate-dcop-data-for-file-commands-339347/)

carl0ski 07-02-2005 09:55 AM

manipulate dcop data for File commandS?
 
Hi
i'm trying to grab the data from this dcop command and manipulate it in the command line
make symlinks, copy move the files etc

Quote:

dcop amarok player path
is the command to view the Path of current song
Quote:

/mnt/music/Artist/Album/Track01.ogg
but i can't figure how i can use this data in a script :(

i've tried
cp "dcop amarok player path" /home/carl0ski/


/mnt/music/Artist/Album/Track01.ogg > %song
cp %song /home/carl0ski/



#!/bin/bash
ln -s $1 /home/carl0ski/Desktop/music/

sh ./copysongscript.sh %song




but all create a text file called %song with the file name contained, not a physical copy of the file :(.

thanks :)

carl.waldbieser 07-02-2005 11:49 AM

I am not *exactly* sure what you are trying to do, but it looks like you want to have a script that when you run it copies the current playing song to your home directory?

The version of amarok I am using does not support the "dcop amarok player path" command, but assuming that works fine for your version, the following bash script should work-- I obviously cannot test it for bugs, though:

Code:

#!/bin/bash

##################################
# Copies currently playing amarok song to my home
# directory.
##################################

cp "$(dcop amarok player path)" ~


carl0ski 07-02-2005 08:46 PM

Quote:

Originally posted by carl.waldbieser
I am not *exactly* sure what you are trying to do, but it looks like you want to have a script that when you run it copies the current playing song to your home directory?

The version of amarok I am using does not support the "dcop amarok player path" command, but assuming that works fine for your version, the following bash script should work-- I obviously cannot test it for bugs, though:

Code:

#!/bin/bash

##################################
# Copies currently playing amarok song to my home
# directory.
##################################

cp "$(dcop amarok player path)" ~


i mainly wanted to easily rename certain songs, maybe fixiup permission errors on some that prevent tags being written :)
because once i figure out how to do this i can figure out how to rename files to suit the tag eventually :)

thank you.

example

cp "$(dcop amarok player path)" ~/Desktop/music/"$(dcop amarok player artist)"\ -\ "$(dcop amarok player title)".mp3


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