[SOLVED]Can't turn off screen blanking: bug in /.xinitrc

Please post any bugs you have found
Post Reply
Message
Author
User avatar
linuph
Posts: 128
Joined: Mon 04 Jun 2012, 02:29
Location: Philippines

[SOLVED]Can't turn off screen blanking: bug in /.xinitrc

#1 Post by linuph »

I've been struggling with screen blanking: every 10 minutes screen blanking kicks in when there is no keyboard- of mouse activity during that time. However, I need the screen to be on all the time. I found that xset sets a.o. screen blanking or not. I tried setting xset in a script in /Startup but that didn't work. It only worked from the commandline which is not handy.
Learning along the way I found that when starting a X-session /.xinitrc is called. There I found a bug (I'm pretty new to Puppy and Linux so I guess it's a bug). See 'NOTE':


/root/.xinitrc:

if [ -f /root/.xset.sh ];then
#this is created by /usr/bin/pupx...
eval "/root/.xset.sh"

NOTE: /root/.xset.sh is NOT created by /usr/bin/pupx
but /tmp/pupx_screen is. Wrong call.

else
##Xorg has it's own fontpath settings in /etc/X11/xorg.conf...
#if [ "`readlink /usr/bin/X`" != "Xorg" ];then
# #xset fp+ /usr/lib/X11/fonts/Type1/
# #xset fp+ /usr/lib/X11/fonts/TTF/
# xset fp+ /usr/share/fonts/default/Type1/
# xset fp+ /usr/share/fonts/default/TTF/
#fi
xset s 600 600 s blank

NOTE: since /root/.xset.sh does not exist, screen blanking
is always activated.

fi

/usr/bin/pupx (menu: pupx: set properties of X):

#v426 add '-dpms' when turn off screensaver...
#/tmp/pupx_screen.sh \$SCREENSAVERFLAG \$SCREENSAVERDELAY
\$SCREENSAVERCYCLE \$SCREENSAVERBLANKING
\$SCREENSAVEREXPOSURES
echo '#!/bin/sh
SCREENSAVERFLAG=$1
SCREENSAVERDELAY=$2
SCREENSAVERCYCLE=$3
SCREENSAVERBLANKING=$4
SCREENSAVEREXPOSURES=$5
SCREENSAVERDELAY=`echo -n $SCREENSAVERDELAY | cut -f 1 -d '.'`
SCREENSAVERCYCLE=`echo -n $SCREENSAVERCYCLE | cut -f 1 -d '.'`
if [ "$SCREENSAVERFLAG" = "false" ];then
SCREENSAVERPARAMS="s off -dpms"

NOTE: we want the above 's off -dpms' but it is not evaluated by /root/.initric

else
[ "$SCREENSAVERBLANKING" = "false" ] &&
SCREENSAVERBLANKING=noblank
[ "$SCREENSAVERBLANKING" = "true" ] &&
SCREENSAVERBLANKING=blank
[ "$SCREENSAVEREXPOSURES" = "false" ] &&
SCREENSAVEREXPOSURES=noexpose
[ "$SCREENSAVEREXPOSURES" = "true" ] &&
SCREENSAVEREXPOSURES=expose
SCREENSAVERPARAMS="s $SCREENSAVERDELAY $SCREENSAVERCYCLE
s $SCREENSAVERBLANKING s $SCREENSAVEREXPOSURES"
fi
xset $SCREENSAVERPARAMS
echo -n " $SCREENSAVERPARAMS" >> /tmp/pupx_finalparams
[ $6 ] && exit
Xdialog --title "Screensaver settings" --msgbox "Screensaver parameters
set to:\n${SCREENSAVERDELAY} ${SCREENSAVERCYCLE}
{SCREENSAVERBLANKING} ${SCREENSAVEREXPOSURES}\n(for this
session only)" 0 0
' > /tmp/pupx_screen.sh
chmod 777 /tmp/pupx_screen.sh

I have not changed anything here but have created .xset.sh in root as a workaround:

/root/.xset.sh:

#!/bin/sh
#
xset s off -dpms
#

and made it executable. It works.

Post Reply