From d7ac1726781db42393676974e0dbf002998112f4 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 15 Dec 2017 14:43:37 +0100 Subject: Add setbg-backup with support for randomising a background image --- i3/bin/setbg-pgfplots | 3 +++ 1 file changed, 3 insertions(+) (limited to 'i3/bin/setbg-pgfplots') 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 -- cgit v1.2.3