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.
Just add it to your
.xsessionrc
or.xinitrc
file.If you have admin rights, you can make the setting system-wide in the Xorg server configuration files with option
BlankTime
, for example by creating/etc/X11/xorg.conf.d/50-my-screensaver.conf
:Note that the time unit here is minutes, not seconds as with
xset
, and that0
meansoff
.More information about corresponding options between
xset
and the Xorg configuration (DPMS as well, for example) can be found in the manual page forxorg.conf
.--
man xorg.conf
(Xorg X server 1.20.4)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.
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.