Posts: 39
drghughes
Joined: 08 Mar 2009
#1
In previous versions of antiX I've been able to stop the screen from blanking (after about 10 minutes inactivity) by adding the following lines to /etc/X11/xorg.conf.in

Code: Select all

Section"ServerFlags"
      Option"AllowMouseOpenFail""true"
      Option"BlankTime""0"
      Option"StandbyTime""0"
      Option"SuspendTime""0"
      Option"OffTime""0"
EndSection
That's not working in this version.

Any ideas what I need to change so that the screen always stays on?

Thanks!
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#2
I use the following script:

Code: Select all

#!/bin/bash

minutes=16
seconds=$((minutes * 60))

if xset q | grep -q"Standby: [1-9]"; then
    xset  dpms 0 0 0 s 0 0  
    echo"Sleep disabled"
else
    xset  dpms $seconds $seconds $seconds s $seconds $seconds  
    echo"Sleep enabled.  Delay: $minutes minutes"
fi
Actually, the version I use has GUI notifications but they are specific to my window manager. It should be easy to make a version that uses yad or something similar for the notifications.
Posts: 630
Eino
Joined: 12 Oct 2012
#3
To turn off screen blanking temporally just do the following in the terminal. Great for watching movies, or anytime you don't want the screen to blank.
xset -dpms; xset s off

To permanently turn off DPMS use bitjam's script.
Posts: 39
drghughes
Joined: 08 Mar 2009
#4
Thanks guys! That fixed it.

I actually added Eino's code to the $HOME/.fluxbox/startup file so that it's applied all the time.
Posts: 1,028
SamK
Joined: 21 Aug 2011
#5
BitJam wrote:I use the following script...
...It should be easy to make a version that uses yad or something similar for the notifications.
Eino wrote:To turn off screen blanking temporally...
Might control of screen blanking be a good candidate for adding to the Control Center? It seems an obvious place for a useful improvement.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#6
Good suggestion SamK,
Would you mind giving this a go?

Code: Select all

#!/bin/bash
function checkcancel {
    CANOK="$?";
    if ["$CANOK" ="1" ]; then
    echo"Ok Closing";
    exit;
    fi
}
CURRENT_BLANK_TIME_S=$(xset q |grep"Standby:" |cut -d"" -f4)
CURRENT_BLANK_TIME_M=$(($CURRENT_BLANK_TIME_S / 60))
TimeScale=$(yad --title="Screen Blanking" \
 --text="Set the screen blank time\nValue is in minutes" \
 --scale --min-value=0 \
 --max-value=60 \
 --value=$CURRENT_BLANK_TIME_M \
 --mark="Off:0" \
 --mark="1 Hour:60" \
 --width=300 \
 --height=200 \
 --button="gtk-ok:0"  \
 --button="gtk-close:1"  \
  );
checkcancel;
minutes=$TimeScale
if ["$minutes" !="" ]; then
    seconds=$((minutes * 60))
    xset  dpms $seconds $seconds $seconds s $seconds $seconds && 
    if ["$minutes" ="0" ]; then
        yad --title="Screen Blanking" --image="info" --text="Screen set to never blank";
    else
        yad --title="Screen Blanking" --image="info" --text="Screen set to blank after $minutes minute(s)";
    fi
else
    yad --title="Screen Blanking" --image="error" --text="There was no valid amount of time set.";
fi
Last edited by Dave on 30 Jul 2013, 18:48, edited 3 times in total.
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#7
Dave, you need spaces before the line continuations:

Code: Select all

/usr/local/bin/set-sleep-yad
Unable to parse command line: Cannot parse integer value '0--max-value=60--value=16--mark=Off:0--mark=1 Hour:60--width=300--height=200--button=gtk-ok:0' for --min-value
I did a global s/\\$/ \/ and then it worked just fine.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#8
hmm the spaces are in the script on my computer, I guess they were lost when I copied it here __{{emoticon}}__
Thanks for catching that bitjam
Posts: 1,028
SamK
Joined: 21 Aug 2011
#9
Dave wrote: Would you mind giving this a go?
BitJam wrote:...it worked just fine.
As I have been beaten to the test it seems there is little to be gained from repeating it.

One very minor suggestion for a marginal improvement.
From the foot of the script, "There was no valid amount of minutes set."

Might this be better as:
"There was no valid amount of time set."
or
"There was no valid number of minutes set."
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#10
SamK wrote:As I have been beaten to the test it seems there is little to be gained from repeating it.
I only checked out the UI. I did not verify that it affects the sleep time as advertised.
Posts: 1,028
SamK
Joined: 21 Aug 2011
#11
Dave wrote:Would you mind giving this a go?
Tested intervals of 0, 1, 11, 31 minutes. All work as expected.
Posts: 146
Eperbab
Joined: 10 Dec 2012
#12
Thanks. Mate desktop has an"automatic energy saving on/off" applet .. wich doesn't work for me. According to 'xset -q' DPMS features are on, all timings are 0, but the screen still goes blank after 10 minutes.
'xset -q' output when energy saving is off:

Code: Select all

Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  0    cycle:  0
...
DPMS (Energy Star):
  Standby: 0    Suspend: 0    Off: 0
  DPMS is Enabled
  Monitor is On
Now I'm trying out 'xset -dpms' .

** Update: I have doublechecked, and power saving is switched off in the on screen menu of the TV, dpms is off, bios powersaving is off, and it still switches to blank after 10 minutes.

I guess I need a script to toggle the Scroll lock, pause or numlock button in every 5 minutes for watching movies.
Posts: 146
Eperbab
Joined: 10 Dec 2012
#13
Since everything else failed for me, I have searched the web, and just installed xautomation. This package includes xdotool and xte.
I will try to write a"numlock swith in every 1 minute" script.

OFF: During the search also found this:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://code.google.com/p/autokey/"
linktext was:"autokey"
====================================
. Not related to this thread, but interesting.
Posts: 765
rust collector
Joined: 27 Dec 2011
#14
hmm, are you sure it is power saving as such, and not a"blank" screensaver?
Posts: 146
Eperbab
Joined: 10 Dec 2012
#15
I have switched off energy saving features with the mate applet, configured to run a blank screensaver after 2 billion seconds of delay, in dconf editor disabled the screensaver, screen blanking and monitor dpms features for AC, UPS & battery mode (I have a desktop without ups). Switched off dpms features of the monitor in the on-screen menue, and also in pc bios.
After that I switched off the screensaver service with boot up manager, run terminal commands like 'xset -dpms s 0 s noblank s noexpose
' , 'xset dpms 0 0 0 s 0 0 && xset -dpms' and the screen went blank after 10 minutes.

As a temporary solution, I have this script:

Code: Select all

#!/bin/sh 
while [ 1 ]; do 
    sleep 60
    xte"key Num_Lock"
done
It works. Tested for 17 minutes. But i would prefer the normal way to switch off dpms features while watching movies. I will ask it on the mate desktop forum.

** Update: i added a menu icon to start the script with 'roxterm -e /home/common/no_blank/noblank.sh'. So it runs in a terminal, and i can"switch on" dpms features by closing the terminal.