Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 25th January 2010, 09:38 PM
Jamwa Offline
Registered User
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 560
Amarok Now Playing

Having been frustrated by the existing now-playing scripts, I wrote this one for myself. Tested on Amarok 2.2 and Kopete 0.80., feel free to extend it to Pidgin (note attached, I dont use pidgin so I cannot test it yet).

A downloadable tar installer script is also available.

#         FILE: amarok_now_playing
#        USAGE: amarok_now_playing [ > logfile]
# DESCRIPTION: Changes your status message in pidgin and/or
#               Kopete to the song you are currently listening to in Amarok.
#      OPTIONS: see function ’usage’ below
# REQUIREMENTS: --- Amarok 2.2, Kopete 0.70
#         LICENCE: GNU GPL
#        NOTES: ---
#       AUTHOR: Arthur Buliva, arthurbuliva [at] fedoraproject [dot] org
#      COMPANY: Arthur Buliva
#      VERSION: 1.0
#      CREATED: 26.05.2009 - 16:17:51
#     REVISION: 16.10.2009 - 12:32:36

STARTUP="qdbus org.kde.amarok / Identity"
PIDGIN="`kopete --version`"

#Messages to display if Amarok is not playing any song

"Amarok is Quiet",
"Long live KDE"

#Test for Amarok
echo -n "Checking Amarok version... "
a=`$STARTUP | cut -c 8-`
if [[ "$a" =~ "${ALLOWED_AMAROK_VERSION}" ]]
    echo "Amarok $a [ OK ] "
    echo -n $a;tput setaf 1;tput bold;echo -n "     [ FAILED ] ";tput sgr0;echo "Make sure that you are running Amarok 1.4 | `date +%b-%d-%Y\ %T` ";
    logger "$0 failed to start. Detected Amarok $a but requires Amarok $ALLOWED_AMAROK_VERSION"

#Test for Kopete
echo -n "Checking Kopete version... "
    echo "Kopete $PIDGIN [ OK ] "
  echo -n $a;tput setaf 1;tput bold;echo -ne "\nERROR: ";tput sgr0;echo "This script has been tested on Kopete 0.70 only | `date +%b-%d-%Y\ %T` "
  logger "$0 failed to start. Detected Kopete $PIDGIN but requires Kopete 0.70"


    if [[ "`$STARTUP`" != "" ]]

    SONG_TITLE="qdbus org.kde.amarok /Player GetMetadata"
    ARTIST="qdbus org.kde.amarok /Player GetMetadata"

    KOPETE_STATUS='qdbus org.kde.kopete /Kopete'
    if [[ "`$KOPETE_STATUS`" == "" ]]
	tput setaf 1;tput bold;echo -n "ERROR: ";tput sgr0;echo "Kopete is not running. This script will terminate | `date +%b-%d-%Y\ %T` "
	logger "$0 terminated because Kopete is not running"

    if [[ "`$SONG_TITLE  | grep title: | cut -c 8-`" != "" ]]
	TITLE="♫ `$SONG_TITLE  | grep title: | cut -c 8-` by `$ARTIST  | grep artist: | cut -c 9- `";
	logger "$TITLE";
	echo $TITLE;
	#`/usr/bin/purple-remote "setstatus?status=available&message=$TITLE"`
	qdbus org.kde.kopete /Kopete  org.kde.Kopete.setIdentityOnlineStatus "Online" "$TITLE"
	sleep 10;
	TITLE=${MESSAGES[ $[ ( $RANDOM % 1 )  + 1 ] - 1  ])};
	echo $TITLE;
	#`/usr/bin/purple-remote "setstatus?status=available&message=$TITLE"`
	qdbus org.kde.kopete /Kopete  org.kde.Kopete.setIdentityOnlineStatus "Online" "$TITLE"
	sleep 30;

	tput setaf 1;tput bold;echo -n "ERROR: ";tput sgr0;echo "Could not connect to DCOP Server | `date +%b-%d-%Y` "
	logger "$0 Could not connect to DCOP Server"

Reply With Quote

amarok, playing

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
Amarok not playing after yum update Jamwa Using Fedora 2 30th December 2009 07:26 PM
amarok mp3 playing problem Yentor Using Fedora 7 5th August 2009 08:18 PM
Amarok on Fedora 10 not playing any song manuleka Using Fedora 6 26th May 2009 02:27 PM
problem with amarok playing mp3 mohan.10 Using Fedora 4 8th October 2008 09:48 PM
kaffeine, amarok not playing in FC8 shreedhan Using Fedora 5 30th November 2007 05:25 PM

Current GMT-time: 08:35 (Saturday, 31-01-2015)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

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
...friendship Tag song luxury on Instagram onedirection nintendo Instagram Tag enjoy Tag