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 would like to be able to turn off my screen upon a keypress. I need vbetool to do that (xset dpms force off just blanks it, does not turn it off). However, vbetool needs root priviledges. So I put line my_user_name ALL=NOPASSWD:/usr/sbin/vbetool" into my sudoers file with visudo. However, when I run vbetool dpms off, it says

mmap /dev/zero: Operation not permitted
Failed to initialise LRMI (Linux Real-Mode Interface).

Any ideas how to solve this?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

So it turns of the line to put to visudo needs to be as follows:

my_user_name ALL=(ALL) NOPASSWD: /usr/sbin/vbetool

Then sudo vbetool dpms off works.

However, it seems xset dpms force off does the same thing after all. I think it did not work that way a couple of releases back, but now it works.

share|improve this answer
    
BTW: when assigning a two key shortcut (for example ctrl + e)to xset dpms force off, one needs to add delay to is since releasing the second key will turn the screen back on. So create a script #!/bin/bash sleep 1 xset dpms force off and assign this script to a shortcut. –  sup Mar 21 '12 at 12:20
add comment

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.