Move display scheduled on/off from notes to docs

This commit is contained in:
KemoNine 2020-08-01 00:35:46 +00:00
parent d60abf3359
commit 25fe578ca3
3 changed files with 60 additions and 65 deletions

View file

@ -30,3 +30,4 @@ Items marked ```REQUIRED``` are assumed to be setup and working. You've been war
* [Web File Manager (Picture Sync)](filebrowser.md)
* [SyncThing (Picture Sync)](syncthing.md)
* [rclone (Picture Sync)](rclone.md)
* [HDMI Scheduled On/Off](scheduled_display.md)

59
docs/scheduled_display.md Normal file
View file

@ -0,0 +1,59 @@
# 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=*-*-* 6: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
```

View file

@ -1,71 +1,6 @@
########################################
# wifi setup
########################################
nmtui # final wifi config to keep wires to a minimum (COCKPIT SETUP REQUIRED)
# use wifi-menu if not using network manger (network manager is part of cockpit setup)
########################################
# hdmi on/off commands
########################################
vcgencmd get_lcd_info
vcgencmd display_power 0
vcgencmd display_power 1
########################################
# schedule on/off of monitor
########################################
cat > /etc/systemd/system/screen-on.timer <<EOF
[Unit]
Description=Turn on display
[Timer]
OnCalendar=*-*-* 6: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