Cleanup slideshow to match 20200828-4 release of pf-ui

This commit is contained in:
KemoNine 2020-08-28 21:18:45 -04:00
parent d260b81ed4
commit a92d742d86

View file

@ -18,13 +18,21 @@ wget $DL_URL -O /usr/local/bin/pf-ui
chmod a+x /usr/local/bin/pf-ui chmod a+x /usr/local/bin/pf-ui
# Setup systemd service for UI # Setup systemd service for UI
mkdir /etc/systemd/system/getty@tty1.service.d/ cat > /etc/systemd/system/pf-ui.service <<EOF
cat > /etc/systemd/system/getty@tty1.service.d/override.conf <<EOF [Unit]
Description=PiFrame UI
After=getty.target
[Service] [Service]
ExecStart= User=root
ExecStart=-/usr/local/bin/pf-ui ExecStart=/usr/local/bin/pf-ui
Restart=always
TTYPath=/dev/tty1
StandardInput=tty StandardInput=tty
StandardOutput=tty StandardOutput=tty
[Install]
WantedBy=multi-user.target
EOF EOF
# Add fim user and setup fim # Add fim user and setup fim
@ -47,38 +55,28 @@ _display_status=0;
_display_status_bar=0; _display_status_bar=0;
_display_status_fmt=0; _display_status_fmt=0;
EOF EOF
# Setup slideshow script stuff
cat > /etc/default/fim_albums <<EOF cat > /etc/default/fim_albums <<EOF
/tank/pictures /tank/pictures
EOF EOF
cat > /usr/local/bin/pf-fim.sh <<EOF cat > /usr/local/bin/pf-fim.sh <<EOF
#!/bin/bash #!/bin/bash
chvt 1 /usr/bin/chvt 1
tput civis /usr/bin/tput -T screen civis > /dev/tty1
exec </dev/tty1 >/dev/tty1 2>/dev/tty1 #exec </dev/tty1 >/dev/tty1 2>/dev/tty1
#echo 2 > /sys/class/graphics/fbcon/rotate_all #echo 2 > /sys/class/graphics/fbcon/rotate_all
ALBUM_PATH=\`cat /etc/default/fim_albums\` ALBUM_PATH=\`cat /etc/default/fim_albums\`
/usr/bin/fim --verbose --no-commandline --no-history --etc-fimrc /usr/local/etc/fimrc \ /usr/bin/fim --verbose --no-commandline --no-history --etc-fimrc /usr/local/etc/fimrc \
--device /dev/fb0 --vt 1 \ --device /dev/fb0 --vt 1 \
--execute-commands-early "clear" --final-commands "clear" \ --execute-commands-early "clear" --final-commands "clear" \
--execute-commands 'while(1){display;sleep "300";next;}' \
--autozoom --random \ --autozoom --random \
--cd-and-readdir --recursive \ --cd-and-readdir --recursive \
"\$ALBUM_PATH" "\$ALBUM_PATH"
EOF EOF
chmod a+x /usr/local/bin/pf-fim.sh chmod a+x /usr/local/bin/pf-fim.sh
cat > /etc/systemd/system/pf-ui.service <<EOF
[Unit]
Description=PiFrame UI
After=getty.target
[Service] # Setup console config stuff
User=fim
ExecStart=/usr/local/bin/pf-ui
Restart=always
[Install]
WantedBy=multi-user.target
EOF
cat > /usr/local/bin/no-cursor-tty1.sh <<EOF cat > /usr/local/bin/no-cursor-tty1.sh <<EOF
#!/bin/bash #!/bin/bash
/usr/bin/tput -T screen civis > /dev/tty1 /usr/bin/tput -T screen civis > /dev/tty1
@ -97,6 +95,7 @@ ExecStart=/usr/local/bin/no-cursor-tty1.sh
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
# Setup watcher for filesystem events
DL_URL=$(curl https://git.kemonine.info/api/v1/repos/PiFrame/piframe-go/releases | jq -r '.[0].assets[] | select(.name == "inotify") | .browser_download_url') DL_URL=$(curl https://git.kemonine.info/api/v1/repos/PiFrame/piframe-go/releases | jq -r '.[0].assets[] | select(.name == "inotify") | .browser_download_url')
wget $DL_URL -O /usr/local/bin/pf-inotify wget $DL_URL -O /usr/local/bin/pf-inotify
chmod a+x /usr/local/bin/pf-inotify chmod a+x /usr/local/bin/pf-inotify
@ -118,8 +117,9 @@ EOF
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now no-cursor-tty1 systemctl enable --now no-cursor-tty1
systemctl enable getty@tty1.service systemctl disable getty@tty1.service
systemctl restart getty@tty1.service systemctl stop getty@tty1.service
systemctl enable --now pf-ui
systemctl enable --now inotify-pictures systemctl enable --now inotify-pictures
``` ```