aboutsummaryrefslogtreecommitdiff
path: root/i3/bin/setbg-pgfplots
diff options
context:
space:
mode:
authorCamil Staps2017-02-20 10:06:38 +0100
committerCamil Staps2017-02-20 10:06:38 +0100
commit73ae3a47a410eb2db9c3c776c0252e1feaeb2d7e (patch)
tree4835551f5d769ede433ed390d3cfc2406975480c /i3/bin/setbg-pgfplots
parentCloogle stats in status bar (diff)
Reorganise binaries
Diffstat (limited to 'i3/bin/setbg-pgfplots')
-rwxr-xr-xi3/bin/setbg-pgfplots22
1 files changed, 22 insertions, 0 deletions
diff --git a/i3/bin/setbg-pgfplots b/i3/bin/setbg-pgfplots
new file mode 100755
index 0000000..7343f35
--- /dev/null
+++ b/i3/bin/setbg-pgfplots
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+SCR_WIDTH=1980
+SCR_HEIGHT=1080
+PADDING=50
+FONT_SIZE=20
+
+let "SCR_WIDTH -= 2 * $PADDING"
+let "SCR_WIDTH /= 2"
+let "SCR_HEIGHT -= 2 * $PADDING"
+
+NR=$RANDOM
+let "NR %= 524"
+
+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
+
+montage -geometry "+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg.png "/tmp/bg-$NR.png"
+rm /tmp/bg{,-src}.png
+
+feh -B white --bg-max "/tmp/bg-$NR.png"
+