aboutsummaryrefslogtreecommitdiff
path: root/i3/bin/setbg-texample
diff options
context:
space:
mode:
authorCamil Staps2017-02-27 11:59:52 +0100
committerCamil Staps2017-02-27 11:59:52 +0100
commitcfc62b7c240bbc3a9e09a62ddf89b597b335b17c (patch)
treeb1375e7c301901f52c937f872d399c450c6435a3 /i3/bin/setbg-texample
parentFix setbg-texample (diff)
Update setbg-texample to use curl
Diffstat (limited to 'i3/bin/setbg-texample')
-rwxr-xr-xi3/bin/setbg-texample8
1 files changed, 5 insertions, 3 deletions
diff --git a/i3/bin/setbg-texample b/i3/bin/setbg-texample
index d5befd6..b8fc463 100755
--- a/i3/bin/setbg-texample
+++ b/i3/bin/setbg-texample
@@ -5,6 +5,8 @@ SCR_HEIGHT=1080
PADDING=50
FONT_SIZE=20
+CURL="curl -s"
+
function fail() {
if [ -f ~/.bg.png ]; then
feh --bg-max -B white ~/.bg.png
@@ -24,7 +26,7 @@ PAGE=$RANDOM; let "PAGE %= 22"; let "PAGE += 1"
# Fetch list of texamples
cd /tmp
-wget -qO texample.html "http://texample.net/tikz/examples/all/?page=$PAGE"
+$CURL -o texample.html "http://texample.net/tikz/examples/all/?page=$PAGE"
if [ $? -ne 0 ]; then fail; fi
EXAMPLES="$(grep '^<dl' texample.html | wc -l)"
@@ -35,8 +37,8 @@ TEX="$(grep '\/media\/tikz\/examples\/TEX' texample.html | grep -v overleaf | se
echo $PDF $TEX
-wget -qO- "http://texample.net$PDF" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg.png
-wget -qO- "http://texample.net$TEX" | sed -n '/\\begin{document}/,/\\end{document}/p' | pygmentize -l latex -O font_size=$FONT_SIZE -o /tmp/bg-src.png
+$CURL "http://texample.net$PDF" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg.png
+$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.png "/tmp/bg-$PAGE.png"
rm /tmp/bg{,-src}.png