Alvaro
Posts: 29
Joined: Sun Aug 19, 2012 8:47 am

Setting screen blanking on every boot

Tue Nov 13, 2012 6:31 pm

When I am watching a movie, I don't want to wait for 10 minutes until the borders go black, so I have set the time to 60 seconds with the following command (as root):

Code: Select all

xset s 60
What is the easiest way to automatically run this command on every boot?

User avatar
k4gbb
Posts: 52
Joined: Sun Aug 12, 2012 5:33 am
Location: Dunnellon, FL USA - EL88tx

Re: Setting screen blanking on every boot

Tue Nov 13, 2012 9:57 pm

Try placing the command in /etc/rc.local
The Grass may be greener on the other side of the fence, but it still has to be mowed.

Alvaro
Posts: 29
Joined: Sun Aug 19, 2012 8:47 am

Re: Setting screen blanking on every boot

Wed Nov 14, 2012 6:37 pm

That didn't work.

Code: Select all

root@raspberrypi:~# cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
xset s 60

exit 0
Anything wrong with what I did?

User avatar
jojopi
Posts: 3226
Joined: Tue Oct 11, 2011 8:38 pm

Re: Setting screen blanking on every boot

Wed Nov 14, 2012 6:56 pm

xset needs to be run after X starts, and from inside the X environment. So you can not put it in rc.local.

See the threads about "disable screen blanking", but use "60" instead of "off".

Alvaro
Posts: 29
Joined: Sun Aug 19, 2012 8:47 am

Re: Setting screen blanking on every boot

Thu Nov 15, 2012 4:27 pm

I think I have tried them all. The only thing that works is xset, and I have to type that manually. Always. No big deal since I only reboot on kernel upgrades, but still...

Return to “Raspberry Pi OS”