2020-07-31 23:56:17 +00:00
# Slideshow
2020-08-03 01:05:29 +00:00
The below commands will setup ```fim``` as a slideshow on your display.
2020-07-31 23:56:17 +00:00
## Important Notes
2020-08-03 01:05:29 +00:00
* ```fim``` will crash if there are no photos for it to use as a slideshow
* You will likely want to tweak the ```fim``` command invocation below. These are great settings as a starting point but you'll probably want to make adjustments for your use case.
* This setup uses ```incron``` to restart ```fim``` when photos are deleted from the pictures folder. Without this piece ```fim``` will crash if a picture is removed from the pictures directory prior to ```fim``` rescaning the pictures directory.
2020-07-31 23:56:17 +00:00
## Setup
``` sh
2020-08-03 01:05:29 +00:00
useradd -m -G video -s /usr/sbin/nologin fim
apt install acl
2020-08-03 18:01:45 +00:00
setfacl -m "u:fim:rwX" /tank/pictures
setfacl -dm "u:fim:rwX" /tank/pictures
2020-08-03 01:05:29 +00:00
apt install fim imagemagick ttf-dejavu
cat > /home/fim/.fimrc < < EOF
2020-08-03 07:03:35 +00:00
# Tweak left of status bar to show filename and taken date/time only
2020-08-03 01:05:29 +00:00
_display_status_fmt="%N %?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?";
2020-08-03 07:03:35 +00:00
# Tweak right of status bar to show image/total only
_info_fmt_str="%i/%l%P";
unbind " ";
unbind "!";
unbind """;
unbind "#";
unbind "$";
unbind "%";
unbind "&";
unbind "’ ";
unbind "(";
unbind ")";
unbind "*";
unbind "+";
unbind ",";
unbind "-";
unbind ".";
unbind "/";
unbind "0";
unbind "1";
unbind "2";
unbind "3";
unbind "4";
unbind "5";
unbind "6";
unbind "7";
unbind "8";
unbind "9";
unbind ":";
unbind ";";
unbind "< ";
unbind "=";
unbind ">";
unbind "?";
unbind "@";
unbind "A";
unbind "Any";
unbind "B";
unbind "BackSpace";
unbind "Backspace";
unbind "C";
unbind "C-a";
unbind "C-b";
unbind "C-c";
unbind "C-d";
unbind "C-e";
unbind "C-f";
unbind "C-g";
unbind "C-h";
unbind "C-i";
unbind "C-j";
unbind "C-k";
unbind "C-l";
unbind "C-m";
unbind "C-n";
unbind "C-o";
unbind "C-p";
unbind "C-q";
unbind "C-r";
unbind "C-s";
unbind "C-t";
unbind "C-u";
unbind "C-v";
unbind "C-w";
unbind "C-x";
unbind "C-y";
unbind "C-z";
unbind "D";
unbind "Del";
unbind "Down";
unbind "E";
unbind "End";
unbind "Enter";
unbind "Esc";
unbind "F";
unbind "G";
unbind "H";
unbind "Home";
unbind "I";
unbind "Ins";
unbind "J";
unbind "K";
unbind "L";
unbind "Left";
unbind "M";
unbind "N";
unbind "O";
unbind "P";
unbind "PageDown";
unbind "PageUp";
unbind "Q";
unbind "R";
unbind "Right";
unbind "S";
unbind "T";
unbind "Tab";
unbind "U";
unbind "Up";
unbind "V";
unbind "W";
unbind "X";
unbind "Y";
unbind "Z";
unbind "[";
unbind "\";
unbind "]";
unbind "^";
unbind "_";
unbind "’ ";
unbind "a";
unbind "b";
unbind "c";
unbind "d";
unbind "e";
unbind "f";
unbind "g";
unbind "h";
unbind "i";
unbind "j";
unbind "k";
unbind "l";
unbind "m";
unbind "n";
unbind "o";
unbind "p";
unbind "q";
unbind "r";
unbind "s";
unbind "t";
unbind "u";
unbind "v";
unbind "w";
unbind "x";
unbind "y";
unbind "z";
unbind "{";
unbind "|";
unbind "}";
unbind "~";
2020-07-31 23:56:17 +00:00
EOF
2020-08-03 01:05:29 +00:00
cat > /usr/local/bin/fim-slideshow.sh < < EOF
2020-07-31 23:56:17 +00:00
#!/bin/bash
2020-08-03 07:03:35 +00:00
# options inspiration: https://www.raspberrypi.org/forums/viewtopic.php?t=196043
tput civis
/usr/bin/fim --verbose --no-commandline --no-history \
--device /dev/fb0 --vt 1 \
--execute-commands-early "clear" --final-commands "clear" \
--execute-commands 'while(1){display;sleep "300";next;}' \
--autozoom --random \
--cd-and-readdir --recursive \
/tank/pictures
2020-07-31 23:56:17 +00:00
EOF
2020-08-03 01:05:29 +00:00
chmod a+x /usr/local/bin/fim-slideshow.sh
cat > /etc/systemd/system/fim.service < < EOF
[Unit]
Description=fim slideshow
2020-08-03 07:31:56 +00:00
After=getty.target
2020-08-03 01:05:29 +00:00
[Service]
User=fim
ExecStart=/usr/local/bin/fim-slideshow.sh
[Install]
WantedBy=multi-user.target
2020-07-31 23:56:17 +00:00
EOF
2020-08-03 01:05:29 +00:00
systemctl daemon-reload
systemctl stop getty@tty1
systemctl disable getty@tty1
2020-08-03 07:31:56 +00:00
cat > /usr/local/bin/no-cursor-tty1.sh < < EOF
#!/bin/bash
/usr/bin/tput -T screen civis > /dev/tty1
EOF
chmod a+x /usr/local/bin/no-cursor-tty1.sh
cat > /etc/systemd/system/no-cursor-tty1.service < < EOF
[Unit]
Description=Disable tty1 cursor
After=getty.target
[Service]
User=root
ExecStart=/usr/local/bin/no-cursor-tty1.sh
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now no-cursor-tty1
2020-08-03 01:05:29 +00:00
systemctl enable --now fim
apt install incron
2020-08-03 18:01:45 +00:00
cat > /etc/incron.d/fim-delete < < EOF
2020-08-03 01:05:29 +00:00
/tank/pictures IN_DELETE systemctl restart fim
2020-08-03 18:01:45 +00:00
EOF
cat > /etc/incron.d/fim-create < < EOF
2020-08-03 17:24:52 +00:00
/tank/pictures IN_CREATE systemctl restart fim
2020-08-03 01:05:29 +00:00
EOF
2020-08-03 17:11:14 +00:00
systemctl enable --now incron
systemctl restart incron
2020-07-31 23:56:17 +00:00
```