aboutsummaryrefslogtreecommitdiff
path: root/i3/bin/setbg-texample
diff options
context:
space:
mode:
authorCamil Staps2017-12-15 15:12:14 +0100
committerCamil Staps2017-12-15 15:12:14 +0100
commit15d2934f146af634d96fdc20ba5237c09e55d157 (patch)
tree2bcb984098ef3f6cd45d2881d11b5d555102449f /i3/bin/setbg-texample
parentAdd Torxakis and SMV plugins for Vim (diff)
Fix setbg
Diffstat (limited to 'i3/bin/setbg-texample')
-rwxr-xr-xi3/bin/setbg-texample6
1 files changed, 3 insertions, 3 deletions
diff --git a/i3/bin/setbg-texample b/i3/bin/setbg-texample
index 610c54f..c1968a5 100755
--- a/i3/bin/setbg-texample
+++ b/i3/bin/setbg-texample
@@ -8,7 +8,7 @@ FONT_SIZE=20
CURL="curl -s"
# Test internet
-timeout 4 wget -q --spider http://texample.net || setbg-backup
+timeout 4 wget -q --spider http://texample.net || setbg-backup || exit 1
let "SCR_WIDTH -= 2 * $PADDING"
let "SCR_WIDTH /= 2"
@@ -20,7 +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" || setbg-backup
+$CURL -o texample.html "http://texample.net/tikz/examples/all/?page=$PAGE" || setbg-backup || exit 1
EXAMPLES="$(grep '^<dl' texample.html | wc -l)"
awk -v n=0 "BEGIN{srand();n=int(rand()*$EXAMPLES)+1} /^<dl/{l++} (l==n){print} END{}" texample.html | sponge texample.html
@@ -35,6 +35,6 @@ $CURL "http://texample.net$PDF" | convert -size "x$SCR_HEIGHT" -density 300 - /t
$CURL "http://texample.net$TEX" | sed -n '/\\begin{document}/,/\\end{document}/p' | pygmentize -l latex -O font_size=$FONT_SIZE -o /tmp/bg-src.png
montage -geometry "+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg-page-0.png "/tmp/bg-$PAGE.png"
-rm /tmp/bg-{page-*,src}.png || setbg-backup
+rm /tmp/bg-{page-*,src}.png || setbg-backup || exit 1
feh -B white --bg-max "/tmp/bg-$PAGE.png"