Unless you want your digital picture frame on display 24/7, you must decide how to control the display power. My articles will show you a few ways, but the easiest for beginners is clock-controlled power management.

In Linux, this is done through the Cron Daemon, a process that runs in the background and triggers defined events at a specified time, as described in the crontab file.

In this article, I will explain how to set up the crontab and configure wake and sleep commands for your digital picture frame. I will also show a Python script for display power management.

Note: The vcgencmd display_power command that used to do this was retired years ago, when the Raspberry Pi desktop moved to Wayland. The commands below use wlr-randr instead.

Read this before you copy anything. wlr-randr only exists inside a wlroots Wayland compositor — wayfire or labwc, i.e. the Raspberry Pi OS desktop image. That is the pi3d PictureFrame build for the Pi 2, 3, 4 and 5, and a cron job calling it has to run as the same user whose desktop session owns the screen, or it will fail silently. If you are on picframe3, skip the crontab altogether — the frame has a screen-off schedule built in, and I describe it at the end of this article.

A Clockwork Raspberry

To turn off a digital picture frame, you deactivate the display. The computer itself, the Raspberry Pi, is never turned off.

Once turned off, there is no way of auto-awakening it — on a Pi 4 and earlier, no battery powers a real-time clock (RTC) on the small board. (The Raspberry Pi 5 does have an RTC and a connector for a coin cell, so it keeps the time across a power cut. It still does not wake itself up from being unplugged.) But since its power consumption is only a few Watts — around 2-3 W idle on a Pi 4, somewhat more on a Pi 5 — it wouldn’t make much difference on your utility bill.

So, when a Raspberry Pi is powered on, it continuously checks for a trigger event—in our case, time. The table with the “wake-up” calls is kept in the crontab file.

To open the crontab, you type in a Terminal window

crontab -e

If you haven’t used crontab -e before, you will be asked which editor you want to use. I recommend #2, the nano editor.

A typical line in the crontab script to trigger a time-based event will look something like this:

00 07 * * 1-5 wlr-randr --output HDMI-A-1 --on

This turns on the digital picture frame screen every Monday to Friday at 7h00. The exact time syntax of the crontab is explained very well on the crontab.guru website, so I won’t go into many details here.

Eight days a week

Here is an example of a script that assumes that from Monday to Friday, the digital picture frame should be turned on at 7h, and on weekends at 8h. From Sunday to Thursday, bedtime is at 22h45, and from Friday to Saturday one hour later.

# Turn off display Sunday - Thursday at 22h45
45 22 * * 0-4 wlr-randr --output HDMI-A-1 --off
# Turn off display Friday - Saturday at 23h45
45 23 * * 5,6 wlr-randr --output HDMI-A-1 --off
# Turn on screen Monday - Friday at 7h00
00 07 * * 1-5 wlr-randr --output HDMI-A-1 --on
# Turn on screen Saturday - Sunday at 8h00
00 08 * * 6,0 wlr-randr --output HDMI-A-1 --on

The command to power off the screen is

wlr-randr --output HDMI-A-1 --off

and to power on, you put

wlr-randr --output HDMI-A-1 --on

Save the file with CTRL+O and exit with CTRL+X. You’re done!

You can add as many time triggers as you like in the crontab.

Powering down the monitor when not needed will save you electricity (about 20 Watts) and may extend the lifespan of your monitor. Others prefer to leave the display on to deter burglars or out of convenience, but that’s up to your preferences.

50 ways to control your display

There are many other methods of automatically controlling the power status of your digital picture frame display.

At home, we have installed a presence detection system. The Raspberry Pi knows when a person is at home based on the Wi-Fi presence of his/her iOS device. You can also try adding a motion sensor.

You can also geofence your home with smartphones and trigger action through IFTTT.

On picframe3 the schedule is a setting

My current frame software does this itself, so there is no crontab and no wlr-randr involved. picframe3 switches the panel through DRM DPMS and reads two settings for the clock:

power:
  schedule:
    all: ["23:00-07:00"]      # screen off overnight
  dim_schedule:
    "20:00-23:00": 0.45       # dim in the evening instead of switching off

Ranges may cross midnight, and a weekday name works in place of all, so you can give the weekend a later start exactly as the crontab above does. The same thing is on the settings page of the frame’s web interface under “when the screen turns off”, which is where I set it rather than editing the file.

Conclusion

While crontab is an easy-to-write command to turn your screen on/off automatically, there is also a more modern alternative now with systemd timers. If your crontab system works fine, there is no need to change to systemd but if you are experiencing problems, have a look at my systemd timer article.