Tag Archives: amarok

Simple workaround to keep PC alive playing songs in Amarok and Gnome

During last months, I must confess, I got a new music player: Amarok.

Now, I would not fall in flame, but Rhythmbox seems still incomplete (and a bit bugged) if compared to Amarok. And, sadly, this is a fact, not an opinion (lol, and this is flame).

Anyway.. Amarok is not able to keep your PC alive when plays something, so if you set a hibernate time in gnome-settings you will see your PC going to sleep while you’re listening some song. And this is really bad..

This little script checks if Amarok is running (and it’s playing something as well) and set hibernate time to 0 (that means: no hibernate) in gnome-settings.


# you MUST set this accoring with your QT installation

# change these as you wish
# daemon time in seconds
# time to hibernate in seconds

# do not touch these
QDBUS_CMD="org.mpris.MediaPlayer2.amarok /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus"

function amarok_on() {
  dconf write $KEY 0

function amarok_off() {
  dconf write $KEY $TIME_HIBERNATE

function check() {
  if [ "$STATUS" == "Playing" ] ; then

while `sleep $TIME_DAEMON` ; do check ; done

Obviously, you have to run this script when a gnome session starts (Startup applications).