Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

Thanks.

share|improve this question

1 Answer 1

up vote 6 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
1  
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

 
discard

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.