Skip to content

Instantly share code, notes, and snippets.

@rogerioadris
Last active July 23, 2020 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerioadris/c0dcdfe04be44538cbd3a03261a4ec95 to your computer and use it in GitHub Desktop.
Save rogerioadris/c0dcdfe04be44538cbd3a03261a4ec95 to your computer and use it in GitHub Desktop.
SplashScreen Raspberry PI

// Criar arquivo boot

sudo vim /etc/systemd/system/boot-splashscreen.service
sudo vim /etc/systemd/system/powerdown-image.service
sudo vim /etc/systemd/system/unplug-image.service

// Instalar lib

sudo apt-get install fim

// Habilitar serviços

sudo systemctl enable boot-splashscreen.service
sudo systemctl start boot-splashscreen.service

sudo systemctl enable powerdown-image.service
sudo systemctl start powerdown-image.service

sudo systemctl enable unplug-image.service
sudo systemctl start unplug-image.service

// boot-splashscreen.service

[Unit]
Description=boot splash screen

[Service]
ExecStart=/usr/bin/fim -q -a /opt/splashscreen/bootimage.png

[Install]
WantedBy=basic.target

// powerdown-image.service

[Unit]
Description=show image on starting shutdown
DefaultDependencies=no
Before=halt.target

[Service]
StandardInput=tty
StandardOutput=tty
ExecStart=/usr/bin/fim -q -a /opt/splashscreen/powerdownimage.jpg
ExecStartPost=/bin/sleep 3

[Install]
WantedBy=halt.target poweroff.target

// unplug-image.service

[Unit]
Description=safe-to-power-off image
DefaultDependencies=no
After=umount.target
Before=final.target

[Service]
StandardInput=tty
StandardOutput=tty
ExecStart=/usr/bin/fim -q -a /opt/splashscreen/unplugimage.jpg
ExecStartPost=/bin/sleep 3

[Install]
WantedBy=shutdown.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment