screensaverpauser

Amarok 1.x Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
pauses amarok on activating the kde screensaver

actually this alwyas works, if your screen is locked
Last changelog:

Now even works with gnome, thanks again to scott!

Now works with 1.4.5 again, thanks to scottmuz77

Changed the things aalcock mentioned


Ratings & Comments

7 Comments

webrat

to get the script working with kde4 and amarok 1.4 you need to change line 11 to Quote:

if [ $(qdbus org.kde.krunner /ScreenSaver org.freedesktop.ScreenSaver.GetActive) = "true" ];then
As KDE4 is no more using DCOP the Script fails without the change.

scottmuz77

I've recently had to use Amarok under Gnome. I've updated the script to work with Gnome which involved some slight refactoring. Since amarok seems to popular with Gnome users I expect others would benefit from this. Hurra if you are happy with this can you check it still works in KDE as I don't have access to KDE. Here it is inline as attachments don't seem to be supported (indentation seem to be lost also) << #!/bin/bash isScreenSaverBlanked () { # Check if GNOME is running if [ $GNOME_DESKTOP_SESSION_ID ]; then isBlanked=$(dbus-send --reply-timeout=2000 --print-reply --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.GetActive 2>&1 | grep boolean | grep true) if [ -n "$isBlanked" ];then return 1 fi else # assume KDE if [ $(dcop kdesktop KScreensaverIface isBlanked) = "true" ];then return 1 fi fi return 0 } while [ true ]; do isScreenSaverBlanked if [ $? = 1 ];then play_status=$(dcop amarok player status) if [ $play_status = 2 ];then $(dcop amarok player playPause) fi isScreenSaverBlanked while [ $? = 1 ]; do sleep 2 isScreenSaverBlanked done if [ $play_status = 2 ];then $(dcop amarok player playPause) fi fi sleep 5 done >>

scottmuz77

This script is great but it stopped working for me when I upgraded to amarok 1.4.5. Replacing both occurences of dcop amarok player pause with dcop amarok player playPause fixes the problem.

hurra

Thanks, i made a new version.

aalcock

Very useful script - It works fine for me. Two improvements:

  1. The "sleep 1" is a bit quick for a script, I've upped it to 5 seconds,
  2. There is a loop while the screen saver is on with no sleep at all. I changed mine to:

      b2=$(dcop kdesktop KScreensaverIface isBlanked)
      while [ $b2 = "true" ];
      do
            b2=$(dcop kdesktop KScreensaverIface isBlanked)
            sleep 2
      done

hurra

Thanks, i made a new version, with the changes ;)

hurra

Very nice ;)

Pling
0 Affiliates
Details
license
version 0.5
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 3

More Amarok 1.x Scripts from hurra:

lyrics_leos [not working anymore]
hurra
last update date: 18 years ago

Score 5.0

synctags
hurra
last update date: 18 years ago

Score 5.0

Other Amarok 1.x Scripts:

Gnome Play Video in Totem
mwheatland
last update date: 19 years ago

Score 5.0

editLyrics-gnome
ZeeD
last update date: 19 years ago

Score 5.0

amarok Alarm
aroth
last update date: 16 years ago

Score 5.0

amaroK Web Collection V xmms
pti-jean
last update date: 16 years ago

Score 5.0

SongLogger
lucatnt
last update date: 17 years ago

Score 5.0

amaroK Web Collection
pti-jean
last update date: 16 years ago

Score 5.0



System Tags