When you boot from the CD, or floppies, type in expert. In expert mode install Debian with only the laptop and base system packages. I suggest not allowing root to login and using sudo, and if you do want to be able to log in as root I would still choose to use sudo at this time. Choosing to use sudo here will allow the user you create to sudo still, and to be able to login as root just run:
sudo passwd
To use feh, which will auto rotate and auto resize the pictures for you on a system that can handle X running:
apt-get install feh imagemagick rungetty autofs udev hal ivman unclutter xserver-xorg xorg
apt-get remove xserver-xorg-video-all doc-debian doc-linux-text info man-db manpages m4 exim4 exim4-base exim4-config mutt procmail ftp tcsh iamerican ibritish ispell dictionaries-common wamerican
apt-get install xserver-xorg-video-vesa xserver-xorg-video-fbdev
Otherwise to use fbi, which will also do a lot of automagic stuff for you and only requires a framebuffer running:
apt-get install autofs udev ivman rungetty hal pmount fbi imagemagickTo explain some of the packages used: *Note, some of the packages may be installed already.
apt-get remove doc-debian doc-linux-text info man-db manpages m4 exim4 exim4-base exim4-config mutt procmail ftp tcsh iamerican ibritish ispell dictionaries-common wamerican
- autofs: This allows the automagic detection of what filesystem is being used on removable media.
- udev: Device manager for the 2.6 kernel. We will be creating a rule to allow us to automagically mount a cd and copy the contents over.
- ivman: Used because it "anounces" the change in a drives state to the system, making the udev rule take affect as soon as the CDROM in this case is inserted.
- rungetty: Used to autologin when booted
- pmount: To allow users to use the mount command
- imagemagick: Always a good tool to have when manipulating images.
- unclutter: Removes the mouse cursor from the screen.
To allow autologin, I suggest installing rungetty (see above) and then changing the inittab.
/etc/inittab
1:2345:respawn:/sbin/getty 38400 tty1
change to
1:2345:respawn:/sbin/rungetty --autologin pictures tty1
#1:2345:respawn:/sbin/getty 38400 tty1
Ok, since this is most likely going to be a gift, and when hacked into being a frame it may or may not have a keyboard it is nice to write a script that will just auto copy the pictures off a cd when inserted.
Script to copy cd files over
/home/pictures/cdcp.sh - Original version
#!/bin/sh/home/pictures/cdcp.sh - Improved version
pmount /dev/cdrom /media/cdrom
cp -r /media/cdrom/* /home/pictures/photos/
pumount /media/cdrom
eject /dev/cdrom
#!/bin/sh
pmount /dev/cdrom /media/cdrom0
find /media/cdrom0 -iname '*.jpg' -exec sh -c 'exec cp -f "$@" /home/pictures/photos/' find-copy {} +
chmod 664 /home/pictures/photos
pumount /media/cdrom0
eject /dev/cdrom
Now that we have a script to copy for us, we need to get it to run when a cd is inserted. This is done by adding a UDEV rule.
/etc/udev/rules.d/udev.rules
SUBSYSTEM=="block", KERNEL=="hdc", RUN+="home/pictures/cdcp.sh"
Now for the actual slideshow script. Assuming this is a gift I am using a duration of 240 seconds, this is how long a picture will stay up before switching to a new one.
The first one is if your using feh.
slideshow.sh
#!/bin/bash
killall feh unclutter
unclutter &
feh -zZFr -D 240 /home/pictures/photos/
A script to restart the slideshow.
restartshow.sh
#!/bin/bash
killall feh unclutter;
/home/pictures/slideshow.sh &
Then to make sure the computer doesn't go to sleep, in case you can not edit the bios for some reason, in the chrontab add the lines to send a signal to the mouse. Also I have a line that restarts the slideshow every 6 hours. its not really needed but if it crashes from some reason it will restart at the six hour mark at least.
$ chrontab -e0,10,20,30,40,50 * * * * echo "Hello there mousey" > /dev/mouse
1,11,21,31,41,51 * * * * echo "Hello there mousey" > /dev/mouse
* 0,6,12,18 * * * /home/pictures/restartshow.sh
Since feh requires X, we need it so start when pictures logs in, and if X quits it will restart itself as well.
/home/pictures/.bash_profile
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
while [ 1 == 1 ]
do
startx
sleep 10
done
fi
Since feh runs in X, you need to tell X that when it starts to start the slideshow. You may need to create this file in the users home directory.
/home/pictures/.xsession
/home/pictures/slideshow.sh
Using fbi you could use the script similar to this:
slideshow.sh
#!/bin/bashNote, as of this posting I have not been able to test the fbi as the IBM Thinkpad 365xd I was trying to use was having issues getting the frame buffer working. Will edit this later to include pictures and the rest of the fbi information.
killall fbi
fbi -a -u -t 240 /home/pictures/photos/*
Sources used to create these scripts and set up the frame are :
http://www.risacher.org/pfl/
http://www.adamfranco.com/archives/3
http://robert.hoisington.googlepages.com/walk-throughandscripts
http://linuxbasement.com/content/digital-picture-frame-howto
https://www.agol.dk/elgaard/picframe.html
http://irisframe.odul.com/mediawiki/index.php/Main_Page

1 comment:
Funny, I actually set up an old computer to act as a digital picture frame as well... I looked for a simple, lightweight, fast and command line driven image viewer. But I chose qiv over feh. Reason? While viewing, feh does not autorotate pictures based on EXIF data. Latest qiv does.
Post a Comment