aboutsummaryrefslogtreecommitdiff
path: root/i3/bin/setbg-texample
diff options
context:
space:
mode:
authorCamil Staps2021-06-28 12:22:48 +0200
committerCamil Staps2021-06-28 12:22:48 +0200
commita73acb9b474ce77af4bc54657d32bd2714ce53ec (patch)
tree1016bbbb59b629c0e905fce3a0b464a40f6f97a2 /i3/bin/setbg-texample
parentAdd vim settings for gas and cabal (diff)
Cleanup binaries
Diffstat (limited to 'i3/bin/setbg-texample')
-rwxr-xr-xi3/bin/setbg-texample40
1 files changed, 0 insertions, 40 deletions
diff --git a/i3/bin/setbg-texample b/i3/bin/setbg-texample
deleted file mode 100755
index c1968a5..0000000
--- a/i3/bin/setbg-texample
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-
-SCR_WIDTH=1980
-SCR_HEIGHT=1080
-PADDING=50
-FONT_SIZE=20
-
-CURL="curl -s"
-
-# Test internet
-timeout 4 wget -q --spider http://texample.net || setbg-backup || exit 1
-
-let "SCR_WIDTH -= 2 * $PADDING"
-let "SCR_WIDTH /= 2"
-let "SCR_HEIGHT -= 2 * $PADDING"
-
-PAGE=$RANDOM; let "PAGE %= 22"; let "PAGE += 1"
-
-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 || 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
-
-PDF="$(grep '\/media\/tikz\/examples\/PDF' texample.html | sed "s/.*<a href=\"\([^\"]*\)\">PDF<\/a>.*/\1/")"
-TEX="$(grep '\/media\/tikz\/examples\/TEX' texample.html | grep -v overleaf | sed "s/.*<a href=\"\(.*\)\">TEX<\/a>.*/\1/")"
-
-echo "PDF: $PDF"
-echo "TeX: $TEX"
-
-$CURL "http://texample.net$PDF" | convert -size "x$SCR_HEIGHT" -density 300 - /tmp/bg-page-%d.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-page-0.png "/tmp/bg-$PAGE.png"
-rm /tmp/bg-{page-*,src}.png || setbg-backup || exit 1
-
-feh -B white --bg-max "/tmp/bg-$PAGE.png"