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-texample | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'i3/bin/setbg-texample') diff --git a/i3/bin/setbg-texample b/i3/bin/setbg-texample index c603bce..610c54f 100755 --- a/i3/bin/setbg-texample +++ b/i3/bin/setbg-texample @@ -7,16 +7,8 @@ FONT_SIZE=20 CURL="curl -s" -function fail() { - if [ -f ~/.bg.png ]; then - feh --bg-max -B white ~/.bg.png - fi - exit -1; -} - # Test internet -timeout 4 wget -q --spider http://texample.net -if [ $? -ne 0 ]; then fail; fi +timeout 4 wget -q --spider http://texample.net || setbg-backup let "SCR_WIDTH -= 2 * $PADDING" let "SCR_WIDTH /= 2" @@ -28,8 +20,7 @@ echo "TeXample page: http://texample.net/tikz/examples/all/?page=$PAGE" # Fetch list of texamples cd /tmp -$CURL -o texample.html "http://texample.net/tikz/examples/all/?page=$PAGE" -if [ $? -ne 0 ]; then fail; fi +$CURL -o texample.html "http://texample.net/tikz/examples/all/?page=$PAGE" || setbg-backup EXAMPLES="$(grep '^