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

I am using xfce desktop in ubuntu 12.04 and added the shortcut keys in order to turn off my monitor.

The command "xset dpms force off" works fine in terminal.

But when it added in the keyboard shortcuts, the monitor turns off a second then turns on immediately.

The command "xset dpms force off" added in keyboard shortcuts

So how cann I turn off the monitor by hotkeys?


share|improve this question
up vote 8 down vote accepted

I imagine it's because you're pressing a key... I'd consider setting the command to something that waits for a second, and then runs the command:

sh -c "sleep 1 && xset dpms force off"
share|improve this answer
It works! Thanks a lot. And I made the command to sleep 0.1 second. 1 second is too long to turn monitor off. – zfz Nov 13 '12 at 13:04

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.