This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Maybe could be useful to others

Tags: None
(comma "," separated)
Pietro
Karma
0

Maybe could be useful to others

Thu Jan 06, 2005 1:09 am
Hi everybody,
I\'ve recently tried to configure multimedia keys for amaroK and it went to and end flawless!

Finally, I\'ve figured out that the key I use to switch on/off the main iterface could be also used for launching amaroK.

What a problem!

If I map with khotkeys that key, it steal the shortcut from amaroK... bad, very bad!

How can I accomplish this heavy duty?

Well... let\'s start saying that the main interface appearing/disappearing can be triggered by a dcop call \"dcop amarok player togglePlaylist \"

Whell... let\'s finish saying that if you write down this silly sh script, it launches amaroK only if not running.

#! /bin/sh
pidof amarok
if [ $? != \"0\" ]
then
killall -9 amarok
killall -9 amarok
/usr/bin/amarok
fi
echo amaroK is running

(Please do not blame me for the script. I know that if ALREADY launched, amarok will prevent a SECOND istance. But this kind of magic happens only when a bunch of time is passed. So if I\'m not sure I\'ve pressed the button, yeah they are gummy!, I will press it two o three times before amaroK starts correctly and amaroK will start two or three times more than I wanted!)

So what you have to do is creating a new khotkeys action, make it general, triggered by the key you want, and let it perform two things:

1) dcop amarok player togglePlaylist
2) the script (remeber to chmod +x it)

Hoping could be useful to anybody else than me:)=!!!

Bye bye,
Pietro

PS: Quit shortcut works only when main interface is ACTIVE, so why not write a khotheys dcop call for closing amaroK?
Mike Diehl
Registered Member
Posts
87
Karma
0

Re:Maybe could be useful to others

Mon Jan 10, 2005 9:48 am
`dcop amarok MainApplication-Interface quit` will quit amaroK. B)


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]