Tuesday, January 21, 2014

Raspberry Pi Journal #46

Disable Screensaver

The last couple posts deals with pesky screensaver kept interfering with our display. We certainly want to have an easy way to disable the screen saver, and for that, we need to go to the source: X window session itself.

Most of the instructions I see on the internet specifies .xinitrc file modification. Although it should work, that makes the change permanent. If I can do it via user shell, I'd rather do it that way.

Fortunately, there is a set of xwindow utilities. The one we're interested in is called xset. Disabling DPMS (Energy Star) feature is as simple as

xset -dpms

Enabling it would be

xset +dpms

So, to disable screen blanking, we'd do this:

  1. xset s noblank   #Disable blanking
  2. xset s off       #Disable screensaver
  3. xset -dpms       #Disable Energy Saving

And to enable them, we can do this:

  1. xset s blank      #Enable blanking
  2. xset s on         #Enable screensaver
  3. xset +dpms        #Enable Energy Saving

So I created two scripts: unblank.sh and blank.sh respectively. Oh, I also put sudo command in front of them, just to make sure it takes.

Now, all I have to do in order to disable the screen saver is type


on the command prompt. And to enable it, just type


And there you go. Note that xset does more than just dealing with screen savers. Check out its man page for details.

No comments:

Post a Comment