Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I listen to lots of music while doing non-computer related stuff and my laptop falls asleep after 30 mins, as per my power settings, so I have to go back to the laptop to wiggle the mouse every now and then.

I've noticed that when Totem plays a video, it overrides the power settings - screen remains on all the time and I don't have to do anything.

Is this a specific feature of Totem, or is there any way I can do the same with my sound applications? What about, say, a Flash or HTML5 video player inside a browser?

I'm using a distro based on Ubuntu 10.10, players used are Clementine and Spotify for Linux. Totem came as default on my distro which is why I suspect it's some sort of system preset involved.

share|improve this question
up vote 4 down vote accepted

There are no "presets". Totem simply asks the GNOME session manager to temporarily disable the "session idle" check.

If your music player does not have full GNOME support (as is often the case with desktop environment-agnostic software), you will have to use an external tool; I have written gnome-mpris-inhibit for MPRIS v2-capable players which will inhibit idle as long as music is playing: (requires libnet-dbus-perl)

$ setsid ./gnome-mpris-inhibit clementine
$ setsid ./gnome-mpris-inhibit spotify

(The MPRIS bus name usually matches the program's actual name, but check using the mpris tool just in case. The two examples above are already checked.)

For Flash, the Caffeine tool (ppa) claims to be able to detect video playback. It does not work for HTML 5 yet, though, but it seems to have a clickable manual activation applet. (I don't have Ubuntu so I cannot test it here.)

If all else fails, this gnome-inhibit script can be used to pause the idle check manually:

$ gnome-inhibit --what=idle
gnome-inhibit: pausing until signal; use Ctrl-C to interrupt

Update: GNOME itself now has an equivalent command:

$ gnome-session-inhibit --inhibit-only
Inhibiting until Ctrl+C is pressed...
share|improve this answer
Just tried your script - got execvp: Permission denied . Running as sudo didn't really help. Any ideas? – Andrey Jan 8 '12 at 22:11
You probably forgot to mark it as executable (chmod +x). – grawity Jan 8 '12 at 22:18
Ok, script works now. Though from the several short tests I did it seems to work only after Clementine/Spotify have launched? If so, I guess I'll need to figure out how to automate that - but that's a different question altogether. Thanks for your help! – Andrey Jan 9 '12 at 14:26
@Andrey: The latest version should deal nicely with being started before the player. – grawity Jan 9 '12 at 17:15
Just did a quick test with Spotify and it works perfectly - thank you so much for that script! I'll come back to upvote your answer once I have the reputation for it. – Andrey Jan 10 '12 at 12:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.