piframe/docs/scheduled_display.md

60 lines
1.3 KiB
Markdown
Raw Normal View History

# HDMI Scheduled On/Off
The below comamnds will setup automatic on/off of the monitor connected to the HDMI port on your PiFrame. This is handy as overnight few people are looking at their photos and by turning off the display you'll save power and make the screen last longer.
The below is setup to turn the display on at ```0600``` and off at ```0000```. Please adjust accordingly.
``` sh
cat > /etc/systemd/system/screen-on.timer <<EOF
[Unit]
Description=Turn on display
[Timer]
OnCalendar=*-*-* 06:00:00
Persistent=true
[Install]
WantedBy=timers.target
EOF
cat > /etc/systemd/system/screen-on.service <<EOF
[Unit]
Description=Turn on display
[Service]
Type=oneshot
ExecStart=/opt/vc/bin/vcgencmd display_power 1
StandardOutput=journal
[Install]
WantedBy=multi-user.target
EOF
cat > /etc/systemd/system/screen-off.timer <<EOF
[Unit]
Description=Turn off display
[Timer]
OnCalendar=*-*-* 00:00:00
Persistent=true
[Install]
WantedBy=timers.target
EOF
cat > /etc/systemd/system/screen-off.service <<EOF
[Unit]
Description=Turn off display
[Service]
Type=oneshot
ExecStart=/opt/vc/bin/vcgencmd display_power 0
StandardOutput=journal
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable screen-on.timer
systemctl enable screen-off.timer
```