Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

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:
screenshot.jpg


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
#!/bin/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:
 /etc/lightdm/lightdm.conf
...
[SeatDefaults]
...
session-setup-script=/photos/cache/conky.sh
...




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...
 /photos/cache/conky.txt
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
TEXT
${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/.

-i

Please leave your comments or feedback below!
comments powered by Disqus
Other posts you may like...
Hi! You can search my blog here ⤵
Or browse the recent top tags...

Recent Blog Posts

Review of Stellar Phoenix Photo Recovery software for Mac

A year later and GitLab still doesn't allow to show private project activity

How to remove caked on stickers from old game carts

How to pass parameters to your PHP script via the command line

jPhotoFrame new layout engine explained with examples

Atari Lynx Multi SD Card cartridge review

Jersey JAX-RS filters and interceptors execution order when throwing Exceptions

Why I'll never renew a domain with GoDaddy again

Fake AirPods - HBQ-i7 TWS wireless headset teardown

How to fix Postman error - Failed to import data: format not recognized

Recent Galleries

BMB-012 Nanoblock T-Rex Skeleton Model assembly

Tiny Arcade revision 6 kit assembly and decal application

Atari Lynx repair - Part 5 - McWill LED screen mod installation

Atari Lynx repair - Part 4 - screen cover replacement

Atari Lynx repair - Part 2 - re-capping the motherboard

Atari Lynx repair - Part 3 - broken speaker replacement

Atari Lynx repair - Part 1 - introduction and case disassembly

Building a custom Atari Lynx game box storage shelf unit in a day

Protecting old Atari Lynx game boxes with snug fit plastic sleeves

Monument Valley 2 is released and does not disappoint

Blogs and Friends

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

Blog Activity

Blog Activity