Skip to content

Instantly share code, notes, and snippets.

Created October 10, 2013 14:31
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do? Snapshot
# Snapshot
# Creates a snapshot of embeds (
# for display on the desktop via GeekTool/Nerdtool.
# by Josh Dick -
# This script depends on:
# * webkit2png -
# * imagemagick -
# Both dependencies can be installed on OS X via Homebrew -
# Change the following variables to your liking.
FONT=Helvetica # Name of a font installed on your system.
DISPLAY_NAME=Boston,%20MA # Can be any URL encoded string; won't affect weather data.
# Take a screenshot of embeds and save it to /tmp/weather-full.png
webkit2png -F --transparent --delay=5 --filename weather --dir /tmp "$LATITUDE&lon=$LONGITUDE&name=$DISPLAY_NAME&font=$FONT" > /dev/null
# Process the screenshot with ImageMagick:
# Invert colors, brighten, then add drop shadow.
convert /tmp/weather-full.png \
-negate \
-modulate 150 \
\( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage \
/tmp/weather-full.png > /dev/null
Copy link

More information about this script is available at:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment