Igor's Blog

A while back I wrote an entry on how to get the Lenovo LT1421 USB DisplayLink monitor working on a RaspberryPi. Now I took that a bit further and created a photo frame using the Raspberry Pi model A, a USB monitor and a bunch of software and some custom scripts.

This is part three of this blog post, if you haven't seen the first or second part, you can find them here: https://www.igorkromin.net/index.php/2015/04/06/raspberrypi-and-a-usb-monitor-combined-to-make-a-photo-frame-part-1/ and https://www.igorkromin.net/index.php/2015/04/07/raspberrypi-and-a-usb-monitor-combined-to-make-a-photo-frame-part-2/.

In the two previous parts I set up file sharing, the Xorg and window manager settings and the script to select a random photo. This part shows the full Conky setup required to get the display happening. As a reminder, this is a screenshot of what the Conky script aims to do:

I set up a script that would launch Conky for me. In addition this script turns off HDMI output on the Raspberry Pi because I'm using a USB monitor. Here it is:
 vi /photos/cache/conky.sh
tvservice -o
conky -d -c /photos/cache/conky.txt -X :0

Now to make Conky start automatically when the window manager is started, I added the following configuration to the lightdm config file:

Since I wanted to have the weather forecast displayed in the picture frame, I had to have a way of getting this information. I went for '1d' script from this post: Conky weather+moon scripts (Accuw/WUndergr/NWS/Lunaf.com). However, instead of having Conky execute the script itself, I put it into cron as well, like so (new weather details every 10 minutes):
 crontab -e
*/10 * * * * /home/pi/1d_accuweather_rss/1d

I also copied the ConkyWeather.ttf font file to the ~/.fonts directory.

...and now for the actual Conky script itself...
background no
font Ubuntu:bold:size=11
use_xft yes
xftalpha 0.9
update_interval 2
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent no
double_buffer yes
minimum_size 1366 768
maximum_width 1366
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color ffffff
own_window_colour 111111
alignment top_left
gap_x 0
gap_y 0
uppercase no
imlib_cache_size 0
${image /photos/cache/current.jpg -f 10}
${voffset 130}
${color aaaaaa}
${goto 1080}${voffset -180}${font Origami Mommy:size=20}Date/Time ${voffset -5}${hr 20}
${voffset 24}
${color ffffff}
${goto 1079}${voffset -80}${font Origami Mommy Pixellated:size=65}${time %d}
${goto 1233}${voffset -112}${font Origami Mommy Pixellated:size=39}${time %b}
${goto 1220}${voffset -25}${offset 58}${font Origami Mommy Pixellated:size=19}${time %Y}
${color bbbbff}${voffset -20}
${goto 1079}${voffset -18}${font Origami Mommy:size=60}${time %H}
${goto 1212}${voffset -90}${font Origami Mommy:size=30}:
${goto 1232}${voffset -61}${font Origami Mommy:size=60}${time %M}
${color aaaaaa}
${goto 1080}${voffset -180}${font Origami Mommy:size=20}Weather ${voffset -5}${hr 20}
${color 888888}
${goto 1080}${voffset -40}${font Origami Mommy Pixellated:size=20}Now
${goto 1075}${voffset -5}${color ffffff}${font Origami Mommy:size=13}${execpi 600 sed -n '1p' $HOME/1d_accuweather_rss/weather|awk -F: '{print $2}'}
${goto 1080}${voffset 5}${font conkyweather:size=70}${execpi 600 sed -n '2p' $HOME/1d_accuweather_rss/weather}
${goto 1160}${voffset -100}${font Origami Mommy:size=52}${execpi 600 sed -n '1p' $HOME/1d_accuweather_rss/weather|awk -F: '{print $3}'}
${color 888888}
${goto 1080}${voffset -155}${font Origami Mommy Pixellated:size=20}Today
${goto 1075}${voffset -5}${color ffffff}${font Origami Mommy:size=13} ${execpi 600 sed -n '4p' $HOME/1d_accuweather_rss/weather|awk -FC\ '{print $3}'}
${goto 1080}${voffset 5}${font conkyweather:size=70}${execpi 600 sed -n '5p' $HOME/1d_accuweather_rss/weather}
${goto 1180}${voffset -120}${font Origami Mommy:size=20}${execpi 600 sed -n '4p' $HOME/1d_accuweather_rss/weather|awk -FC\ '{print $2}'}
${goto 1180}${font Origami Mommy:size=20}${execpi 600 sed -n '4p' $HOME/1d_accuweather_rss/weather|awk -FC\ '{print $1}'}
${color 888888}
${goto 1080}${voffset -35}${font Origami Mommy Pixellated:size=20}Tomorrow
${goto 1075}${voffset -5}${color ffffff}${font Origami Mommy:size=13} ${execpi 600 sed -n '7p' $HOME/1d_accuweather_rss/weather|awk -FC\ '{print $3}'}
${goto 1080}${voffset 5}${font conkyweather:size=70}${execpi 600 sed -n '8p' $HOME/1d_accuweather_rss/weather}
${goto 1180}${voffset -120}${font Origami Mommy:size=20}${execpi 600 sed -n '7p' $HOME/1d_accuweather_rss/weather|awk -FC\ '{print $2}'}
${goto 1180}${font Origami Mommy:size=20}${execpi 600 sed -n '7p' $HOME/1d_accuweather_rss/weather|awk -FC\ '{print $1}'}
${goto 1080}${font :size=8}${color 555555}${voffset -27}Web: http://${addr wlan0}/

The image cache is turned off which should automatically refresh the current photo as soon as it's selected by the select.sh script, I do add a 10s refresh just in case though. The weather is updated every 600 seconds inside the script.

I've not bothered with clipping the forecast text, so sometimes it goes off the scree, when the forecast is especially long. I didn't think this would be a huge problem.

This is pretty much it. There is one extra part to this post coming up soon, in that post I describe how I added Apache to the mix so that the photo frame can be viewed in any web browser and controlled too e.g. turning off the screen, forcing the next photo to show up, etc. Keep and eye out for that post in the next couple of days.

Part 4 is posted now, check it out here: https://www.igorkromin.net/index.php/2015/04/15/raspberrypi-and-a-usb-monitor-combined-to-make-a-photo-frame-part-4/.


comments powered by Disqus
Other posts you may like...
Programming, DIY, Games, Hacks, and Tech

Recent Blog Posts

Swapping HDD logic boards between different brand disks - is it possible?

A guide for plotting your hard drive for Burstcoin mining on a Mac using mjminer

Replacing a broken hard drive in a Samsung Story Station

Fix Java applications slow start and net connection times on macOS sierra

Pierre Cardin Leather Computer Bag (PC2278)

How to stop SSH remote host disconnecting your session

Using PayPal PHP SDK on Google App Engine

Use the Touch Bar to lock your Mac with a single button press

Multi module builds with Maven 3.5 and the parent-child pom version management

Google App Engine local dev server DataStore becoming corrupted after a bad GQL statement is run

Recent Galleries

Monument Valley 2 is released and does not disappoint

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

DIY spare parts computer build with a RAIDMAX Anura case

Fake 'Lepin' brand Lego packaging

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

My Other Web Sites

Igor and Elise's Travels
Riverside Expressway Cam
300 George St Blogumentary

My Online Tools

UUID to OID Converter
Guru JSON-RPC Tester
Extrudifier Object Designer
Travel ┬ÁBlog

Blogs and Friends

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
Your call, follow me if you want to read more great posts like this one!
Don't show this again