Black God

DIY: Digital Photo Frame on Linux

Those who want just quick instructions, go to Step-1 directly. I have QNAP TS-110 NAS box with Debian installed in it. I am using it for backup and also as NAS server. This is going to be switched on for 24×7. So I thought of adding a monitor to this headless device and use it as a Digital Photo Frame also. The job is simpler than I expected.

To know more on my hardware setup, installing Debian and configuring backup and NAS functionalites refer here. Though I have a NAS box, the following instructions are applicable to any Linux machine with Debian installed. The backup data on this machine which includes Photos of all my machines in home network – serves as source for photo frame functionality. In case you don’t want NAS/backup functionalites, just install Debian with basic xorg server. My USB monitor is UM-70 Lilliput display of 7″, which can be installed with instructions from another post of mine.

Step-1: Install Debian, basic Xorg server and fluxbox. I have installed light weight fluxbox also for other functionalities proposed for future.

Step-2: Install qiv. qiv is a nice open source image viewer, very much suitable – customizable – for Photo frame functionality.

# apt-get install x11-xserver-utils qiv

Step-3: Create a normal user. Include the above line in ~/.fluxbox/startup of this user just above “exec fluxbox” line. If you don’t want fluxbox, you can use .xinitrc to do the following stuff.

xset -display :0.0 s off &
qiv -f -s -i -t -r -u -d 5 /home/nas/laptop/blackgod/Pictures

The xset command disables blank screensaver, which is essential for Slide show.

The next qiv command is the core slide show program. Note down the absence of & at end of this line, which prohibits running fluxbox desktop, which is not necessary for a photo frame. The last argument is the path of photos. Here is the break-up of argument to qiv.

-f  full screen

-s  slide show

-i  disable status bar

-u  recursively get photos from directory given

-t  fit image size to screen size

-r  randomize slide show

-d <sec>  slide show delay

At this stage, when you start X with startx command, your slide show should start. Now we need to automatically start x and login as normal user and start slide show when the system is power on. This can be done by following step.

Step-4: To get better display life and conserve some power, I enable the Display Power Management System (DPSM) at 10PM and disable it at 8AM daily with this cron tab settings. Create a file called “slideshow” in /etc/cron.d/ as root user with the following content.

0 8     * * *           <username>    /usr/bin/xset -display :0.0 dpms force on

0 22    * * *           <username>    /usr/bin/xset -display :0.0 dpms force off

The first line disables the DPMS at 8AM and second line enables it at 10PM.
In case you have any problem with “dpms force off”, you can try with “dpms force suspend” or “dpms force standby” also.
Step-5: Modify the /etc/initab with following lines as shown below.

id:5:initdefault:

x:5:once:/bin/su <username> -l -c “/bin/bash –login -c /usr/bin/startx > /dev/null 2>&1″
The above lines set default init level as 5. In default init level 5, we start X server for your normal user.
Step-6: Reboot to get your Digital Photo Frame ready.
Here is my Photo frame powered by QNAP TS-110. This is a bonus functionality of my NAS/backup server :-)

3 comments for “DIY: Digital Photo Frame on Linux

  1. Udhaya
    September 14, 2010 at 9:46 am

    its looks good. Where u purchased ? how much.

    • September 14, 2010 at 10:01 am

      I purchased QNAP TS-110 NAS box and Lilliput 7″ USB LCD monitor. Completely removed QNAP firmware and installed Linux to use it for home backup. Additional functionality is to use it as Photo frame with USB monitor plugged in.

      Both are available in Amazon.

Leave a Reply

Your email address will not be published. Required fields are marked *