5

I want to stop monitor from going to sleep in ubuntu 16.04. I am using /etc/X11/xorg.conf file in Ubutnu 14.04, which has below lines written in it.

Section "ServerFlags" 
Option "BlankTime" "60" 
Option "StandbyTime" "0" 
Option "SuspendTime" "0" 
Option "OffTime" "0" 
EndSection

And it is working fine in Ubuntu 14.04 but not working in Ubuntu 16.04.

During research I have found that xorg.conf is removed in Ubuntu 16.04. I want to do the same in Ubuntu 16.04. if anybody has any idea about the same then please let me know.

Thanks.

User2546
  • 179
  • 1
  • 5
  • 16
  • During research I have found that when upgrading to Ubuntu 16.04 from a previous release, both the fglrx driver and the xorg.conf will be removed, so that the system is set to use either the amdgpu driver or the radeon driver (depending on the available hardware). – User2546 Jun 17 '16 at 12:27
  • What about system settings -> brightness and lock ? – EdiD Jun 17 '16 at 15:57
  • Turn off screen after 5 minutes and lock screen after screen turn off. – User2546 Jun 18 '16 at 06:35
  • Change turn screen off : never – EdiD Jun 18 '16 at 07:48
  • Thanks for your reply. I know this but I want a script or .conf file like solution so that when it can be done automatically instead of manual interaction. – User2546 Jun 18 '16 at 08:16

2 Answers2

20

You can use gsettings for enabling and disabling monitor from going to sleep:

  • Disable turning off screen

    gsettings set org.gnome.desktop.session idle-delay 0
    
  • Enable turning off screen with 5 min delay

    gsettings set org.gnome.desktop.session idle-delay 300
    
EdiD
  • 4,457
  • 3
  • 26
  • 41
  • EdiD, Thanks for your reply. In my initial testing it is working in Ubuntu 16.04 as per the expectation. I will test it more and update the test result here. – User2546 Jun 18 '16 at 12:02
  • Thanks for this. Any thoughts on burn-in prevention? Anything to shift around the pixels a bit - this is what Android Wear does to prevent burn-in. – RoundSparrow hilltx Jun 21 '16 at 11:26
  • @RoundSparrowhilltx from what I know pixel shifting is built-in algorithm in plasma and oled tvs and It can't be done from command line. – EdiD Jun 21 '16 at 12:14
  • @EdiD, I have tested "gsettings set org.gnome.desktop.session idle-delay 0" in Ubuntu 16.04 and it works when internet is available but it does not work when internet is not available. Could please suggest the shell script or some kind of configuration so that it can work when internet not available. – User2546 Aug 29 '16 at 12:01
  • @User2546 I can't imagine how idle-delay can be related to Internet connection. – EdiD Aug 29 '16 at 16:10
  • @EdiD, my qt app runs in Ubuntu 16.04. "gsettings set org.gnome.desktop.session idle-delay 0" works in both cases (whether Internet is available or not ) in Ubuntu GUI desktop. But actual need is that my qt app runs in openbox (window utility) in full screen in Ubuntu 16.04 and and this "idle-delay" setting works when internet available but it does not work when internet is not available in openbox. – User2546 Aug 30 '16 at 09:44
  • I have fixed this issue by move mouse cursor by 1 pixel using shell script command in each 30 sec and now monitor is not going to sleep in internet and no internet in both Ubuntu GUI and openbox in Ubuntu 16.04. – User2546 Feb 09 '17 at 07:15
  • The answer is also valid for Ubuntu 18.04. – Mihai Capotă Mar 11 '19 at 17:34
1

IN latest ubuntu, run the command.

gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
drmaa
  • 303
  • 3
  • 12