aboutsummaryrefslogtreecommitdiff
path: root/i3/bin/setbg-pgfplots
diff options
context:
space:
mode:
Diffstat (limited to 'i3/bin/setbg-pgfplots')
-rwxr-xr-xi3/bin/setbg-pgfplots3
1 files changed, 3 insertions, 0 deletions
diff --git a/i3/bin/setbg-pgfplots b/i3/bin/setbg-pgfplots
index 7343f35..1479844 100755
--- a/i3/bin/setbg-pgfplots
+++ b/i3/bin/setbg-pgfplots
@@ -12,6 +12,9 @@ let "SCR_HEIGHT -= 2 * $PADDING"
NR=$RANDOM
let "NR %= 524"
+# Test internet
+timeout 4 wget -q --spider http://cloogle.org || setbg-backup
+
wget -qO- "http://pgfplots.sourceforge.net/example_$NR.pdf" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg.png
wget -qO- "http://pgfplots.sourceforge.net/gallery.html" | sed -n "/example_$NR\.pdf/,/<\/div>/p" | tail -n +6 | head -n -1 | pygmentize -l latex -O font_size=$FONT_SIZE -o /tmp/bg-src.png