Last active
June 30, 2016 08:01
-
-
Save vaelen/0c4af3e6d767ddd4b40bd60ffa076742 to your computer and use it in GitHub Desktop.
This script chooses a random wallpaper, resizes it, places the time on it, and displays it on a 320x240 AdaFruit PiTFT for Raspberry Pi using the framebuffer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export indir=${HOME}/wallpapers | |
export infile=`find ${indir} -type f | sort -R | tail -n 1` | |
export workdir=${HOME}/.wallpaper | |
export resizedfile=${workdir}/resized.png | |
export timefile=${workdir}/time.png | |
export outfile=${workdir}/time-final.png | |
export time=`date` | |
export loc=+15+200 | |
mkdir -p ${workdir} | |
convert -resize 320x240 "${infile}" "${resizedfile}" | |
convert -size 320x240 xc:lightblue -transparent lightblue -pointsize 20 \ | |
-stroke black -strokewidth 8 -annotate ${loc} "${time}" -blur 0x8 \ | |
-fill white -stroke none -annotate ${loc} "${time}" \ | |
"${timefile}" | |
composite -gravity center "${timefile}" "${resizedfile}" "${outfile}" | |
sudo fbi -T 2 -d /dev/fb1 -noverbose -a "${outfile}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment