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

On an almost fresh install of Ubuntu 12.04, after disabling screen turning off, screen lock, and suspension on inactivity from all the (two) places one can find under Ubuntu's System Settings, the screen still turns black after some minutes of inactivity. I can't tell for sure whether it only becomes blank/black or turns off.

I've uninstalled gnome-screensaver, which didn't change anything.

Of the several answers I found out there (most of which I didn't try because they were either unclear or reported to not work for everybody), I tried one that DID work:

sudo xset s off

After which I left the computer unattended for hours and the screen never turned black, so it definitely worked.

However, it does not survive a reboot. After reboot, screen starts turning black again after N minutes of inactivity.

Given that xset s off does work until reboot, how do I make that setting permanent?

I guess I could create a script that runs at startup issuing that command, but I think that would be a horrible hack and there should be a cleaner way to accomplish this.

share|improve this question
up vote 4 down vote accepted

Just add it to your .xsessionrc or .xinitrc file.

share|improve this answer

This behavior is initiated at login and overrides the command if run at boot. To make this permanent, just add the lines below to the end of the .profile in your Home folder.

# Turn off screen blanking
xset s off && xset -dpms

If you don't see .profile, open your Home folder in your file browser, click on 'View' and select 'Show Hidden Files'. Then just right click on .profile, select 'Open with text editor', copy and paste the above on a blank line at the end of the file and save the modified file.

share|improve this answer

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.