Add details on how to setup splash screens for startup / shutdown / halt

This commit is contained in:
KemoNine 2020-08-14 02:13:23 -04:00
parent 5efed720ff
commit 6f5ce35fee
5 changed files with 87 additions and 0 deletions

View File

@ -31,3 +31,4 @@ Items marked ```REQUIRED``` are assumed to be setup and working. You've been war
* [SyncThing (Picture Sync)](syncthing.md)
* [rclone (Picture Sync)](rclone.md)
* [Resource Monitoring](munin.md)
* [Fun Splash Screens](splash_screens.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

86
docs/splash_screens.md Normal file
View File

@ -0,0 +1,86 @@
# Splash Screens
The below will get you setup with splash screens for boot, shutdown and halt events on your PiFrame.
You will need to obtain your own images for these screens. Please adjust the following accordingly.
## Further Reading / Inspiration
* https://www.madebymany.com/stories/fun-with-systemd-running-a-splash-screen-shutting-down-screens-and-an-iot-product-service-with-python-on-raspberry-pi
* https://yingtongli.me/blog/2016/12/21/splash.html
* https://learn.adafruit.com/pitft-linux-python-animated-gif-player/python-code
``` sh
cat > /etc/systemd/system/fim.service <<EOF
[Unit]
Description=fim slideshow
After=getty.target
[Service]
User=fim
ExecStartPre=-/usr/bin/killall fim
ExecStart=/usr/local/bin/fim-slideshow.sh
Restart=always
RuntimeMaxSec=604800
[Install]
WantedBy=multi-user.target
EOF
cat > /etc/systemd/system/boot-logo.service <<EOF
[Unit]
Description=boot splash screen
DefaultDependencies=no
After=local-fs.target
[Service]
User=fim
ExecStart=/usr/bin/fim --verbose --no-commandline --no-history --device /dev/fb0 --vt 1 --execute-commands-early "clear" --execute-commands 'display;sleep "300";quit;' --autozoom /home/fim/noun_startup_749601.png
Type=exec
[Install]
WantedBy=sysinit.target
EOF
cat > /etc/systemd/system/shutdown-logo.service <<EOF
[Unit]
Description=show image on starting shutdown
DefaultDependencies=no
Before=halt.target poweroff.target reboot.target shutdown.target
[Service]
User=fim
ExecStartPre=-/usr/bin/killall fim
ExecStart=/usr/bin/fim --verbose --no-commandline --no-history --device /dev/fb0 --vt 1 --execute-commands-early "clear" --execute-commands 'display;sleep "300";quit;' --autozoom /home/fim/noun_landing_1746270.png
Type=exec
[Install]
WantedBy=halt.target poweroff.target reboot.target shutdown.target
EOF
cat > /etc/systemd/system/halt-logo.service <<EOF
[Unit]
Description=safe-to-power-off image
DefaultDependencies=no
After=umount.target
Before=final.target
[Service]
User=fim
ExecStartPre=-/usr/bin/killall fim
ExecStart=/usr/bin/fim --verbose --no-commandline --no-history --device /dev/fb0 --vt 1 --execute-commands-early "clear" --execute-commands 'display;sleep "300";quit;' --autozoom /home/fim/noun_unplug_601044.png
Type=exec
[Install]
WantedBy=halt.target halt.target poweroff.target reboot.target shutdown.target
EOF
systemctl daemon-reload
systemctl enable fim.service
systemctl enable boot-logo.service
systemctl enable halt-logo.service
systemctl enable shutdown-logo.service
```