Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carlitoselmago/9af5e0bb4ede82e59574121fd974ec41 to your computer and use it in GitHub Desktop.
Save carlitoselmago/9af5e0bb4ede82e59574121fd974ec41 to your computer and use it in GitHub Desktop.
MPV play on boot service
[Unit]
Description=Play video at startup
After=multi-user.target
[Service]
Environment="DISPLAY=:0"
ExecStart=/bin/bash -c '/home/orangepi/playvideo.sh'
User=orangepi
Restart=on-abort
RemainAfterExit=yes
Type=simple
[Install]
WantedBy=multi-user.target
######################################################################
And then the playvideo.sh:
#!/bin/bash
TRAP '' HUP
cd /home/orangepi
/usr/bin/mpv --vo=drm --loop video.mp4
echo >> /tmp/playvideo.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment