Fedora Linux Support Community & Resources Center
  #1  
Old 9th September 2009, 09:00 AM
MattDobson Offline
Registered User
 
Join Date: Sep 2009
Posts: 13
linuxfedorafirefox
Scripts for Amarok

Hi,

I am new to Fedora and I am needing some help with a script that displays the currently playing album on the desktop, can someone please help me with a simple explanation how to do this.
Reply With Quote
  #2  
Old 9th September 2009, 09:08 AM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 558
linuxfedorafirefox
What audio player are you using?
Reply With Quote
  #3  
Old 9th September 2009, 09:11 AM
MattDobson Offline
Registered User
 
Join Date: Sep 2009
Posts: 13
linuxfedorafirefox
Shoot sorry...Amarok 2.1.1.
Reply With Quote
  #4  
Old 9th September 2009, 09:27 AM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 558
linuxfedorafirefox
Perhaps you could use qdbus. this is a sample output in my case:
Code:
sh-4.0$ qdbus org.kde.amarok /Player GetMetadata
album: Unbekanntes Album (16.01.2007 10:44:12)
artist: BoneyM.
arturl:
audio-bitrate: 128
audio-samplerate: 44100
comment:
genre: Unbekannt
location: file:///windows/jukebox/BoneyM/BoneyM%20-%20Happy%20Song.mp3
mtime: 238000
rating: 0
time: 238
title: Happy Song
tracknumber: 12
year: 0
sh-4.0$
Grep the output to get what you want:

Code:
sh-4.0$ qdbus org.kde.amarok /Player GetMetadata | grep artist
artist: BoneyM.
sh-4.0$ qdbus org.kde.amarok /Player GetMetadata | grep title
title: Happy Song
sh-4.0$
Reply With Quote
  #5  
Old 9th September 2009, 09:35 AM
MattDobson Offline
Registered User
 
Join Date: Sep 2009
Posts: 13
linuxfedorafirefox
This might sound like a silly question but is there a plasmoid that will do the trick for this?
Reply With Quote
  #6  
Old 10th October 2009, 04:18 AM
ozjd Online
Registered User
 
Join Date: Feb 2008
Location: Sydney Australia
Age: 59
Posts: 2,372
linuxfedorafirefox
Quote:
Originally Posted by Jamwa View Post
Perhaps you could use qdbus. this is a sample output in my case:
Code:
sh-4.0$ qdbus org.kde.amarok /Player GetMetadata
album: Unbekanntes Album (16.01.2007 10:44:12)
artist: BoneyM.
arturl:
audio-bitrate: 128
audio-samplerate: 44100
comment:
genre: Unbekannt
location: file:///windows/jukebox/BoneyM/BoneyM%20-%20Happy%20Song.mp3
mtime: 238000
rating: 0
time: 238
title: Happy Song
tracknumber: 12
year: 0
sh-4.0$
Grep the output to get what you want:

Code:
sh-4.0$ qdbus org.kde.amarok /Player GetMetadata | grep artist
artist: BoneyM.
sh-4.0$ qdbus org.kde.amarok /Player GetMetadata | grep title
title: Happy Song
sh-4.0$
This is useful Jamwa Thanks.

I am setting up Conky to show the current track info. However when I do
qdbus org.kde.amarok /Player GetMetadata | grep album

I also get arturl: which is the album art location. Am I doing it wrong, I doubt I am as other lines for artist and title etc. work, or is it a bug? Any suggestions?
Reply With Quote
  #7  
Old 10th October 2009, 04:19 AM
ozjd Online
Registered User
 
Join Date: Feb 2008
Location: Sydney Australia
Age: 59
Posts: 2,372
linuxfedorafirefox
Quote:
Originally Posted by MattDobson View Post
This might sound like a silly question but is there a plasmoid that will do the trick for this?
I know its been a while but if you haven't found it Matt there is a Now Playing plasmoid which works well.
Reply With Quote
  #8  
Old 10th October 2009, 04:24 AM
ozjd Online
Registered User
 
Join Date: Feb 2008
Location: Sydney Australia
Age: 59
Posts: 2,372
linuxfedorafirefox
Silly me

I just worked out what was happening. Amarok save album covers in a folder titled "albumcovers" so it is finding that too. I changed the command to
qdbus org.kde.amarok /Player GetMetadata | grep album:
and the final colon did the trick, I got only the album name.
Reply With Quote
Reply

Tags
amarok, scripts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Scripts imfromwales Using Fedora 9 29th January 2008 07:59 PM
amarok-xone & amarok-extras-nonfree error -- no mp3 playback D= spfdz Using Fedora 1 23rd January 2007 02:07 AM
How do you run scripts Swaytech Using Fedora 12 20th January 2006 06:03 AM
not able to run scripts spie34 Using Fedora 9 26th August 2004 06:31 PM


Current GMT-time: 08:28 (Friday, 24-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Mehtar Lam Photos on Instagram - Uster Photos - Santiago de Cao