MagicMirror/Installation
From r00tedvw.com wiki
(Difference between revisions)
Line 1: | Line 1: | ||
=Custom service to turn on screen= | =Custom service to turn on screen= | ||
Create executable | Create executable | ||
− | <nowiki>~$ mkdir -p /opt/MagicMirrorScreen | + | <nowiki>~$ mkdir -p /opt/MagicMirrorScreen |
− | + | touch /opt/MagicMirrorScreen/magicmirrorscreen.sh | |
chmod +x /opt/MagicMirrorScreen/magicmirrorscreen.sh</nowiki> | chmod +x /opt/MagicMirrorScreen/magicmirrorscreen.sh</nowiki> | ||
+ | <code>~$ vim /opt/MagicMirrorScreen/magicmirrorscreen.sh</code> | ||
+ | <nowiki>#\bin\bash | ||
+ | export DISPLAY=:0 | ||
+ | |||
+ | while true; do | ||
+ | xset s reset | ||
+ | sleep 60 | ||
+ | done</nowiki> | ||
Create Service | Create Service | ||
− | <code>$touch /lib/systemd/system/magicmirrorscreen.service</code> | + | <code>~$ touch /lib/systemd/system/magicmirrorscreen.service</code> |
<nowiki>[Unit] | <nowiki>[Unit] | ||
Description=example systemd service unit file. | Description=example systemd service unit file. |
Revision as of 02:21, 5 June 2024
Custom service to turn on screen
Create executable
~$ mkdir -p /opt/MagicMirrorScreen touch /opt/MagicMirrorScreen/magicmirrorscreen.sh chmod +x /opt/MagicMirrorScreen/magicmirrorscreen.sh
~$ vim /opt/MagicMirrorScreen/magicmirrorscreen.sh
#\bin\bash export DISPLAY=:0 while true; do xset s reset sleep 60 done
Create Service
~$ touch /lib/systemd/system/magicmirrorscreen.service
[Unit] Description=example systemd service unit file. After=magicmirror.service [Service] ExecStart=/bin/bash /opt/MagicMirrorScreen/magicmirrorscreen.sh User=pi [Install] WantedBy=multi-user.target
Create Symlink
~$ ln -s /lib/systemd/system/magicmirrorscreen.service /etc/systemd/system/magicmirrorscreen.service
Restart and enable service
~$ systemctl daemon-reload ~$ systemctl enable magicmirrorscreen.service