Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Hey everyone— I have a home theater PC running Ubuntu 11.10, outputting over HDMI (for audio and video). I'm having an issue: I'd like the screen to lock automatically (when video is not playing, of course) but do not want the screen to turn off automatically, because that kills audio. I can manually lock the screen, of course, but it appears that if you set the "Turn off screen" setting to "never", the screen will never lock, no matter what the "lock screen" timeout is set to.

Is there a way to do what I'm asking, or will I have to install xscreensaver?

share|improve this question
up vote 1 down vote accepted

xscreensaver would be simpler

It would be nice for HDMI audio to stay active, wouldn't it... I don't think there is a way to disable screensaver while video is playing with ubuntu settings. Some players have this setting built in.

I've been playing around with

xset dpms force standby

It does not work with ATI cards but what does :(

You can check more settings with xset -h

Try this, it should work. I wish there was a better solution. It's a blank screensaver. Does not turn off monitor.

xset s blank
xset s 300
xset s on

This blanks the screen after 300sec.

To instantly activate use

sh -c "sleep 1; xset s activate"

if you need to lock the screen, you can use

gnome-screensaver-command -l

You can create a desktop launcher that can be dragged to the unity launcher with

gnome-desktop-item-edit --create-new

If you don't want to use it anymore> To deactivate

xset s off


xset s default

should work.

see here for more details.

So many people use hdmi audio. There should be a better solution.

share|improve this answer
this seems to work as expected. thanks for the thorough answer! – milkandtang Jun 10 '12 at 23:34

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.