diff options
author | Camil Staps | 2016-04-06 22:17:29 +0200 |
---|---|---|
committer | Camil Staps | 2016-11-30 19:11:08 +0100 |
commit | 65223eb4555e7f2a5b64c20f4df19a79cc4f0013 (patch) | |
tree | 09b886df5bea90891c7675061b6551addb3a7568 /bin | |
parent | Fixed nowplaying order (diff) |
pgfplot example as background
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/setbg | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -1,2 +1,20 @@ -#!/bin/sh -if [ -f ~/.bg.png ]; then feh --bg-max -B white ~/.bg.png; fi +#!/bin/bash + +SCR_WIDTH=1980 +SCR_HEIGHT=1080 +PADDING=50 +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 -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=24 -o /tmp/bg-src.png + +montage -geometry "${SCR_WIDTH}x$SCR_HEIGHT+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg.png /tmp/bg.png +rm /tmp/bg-src.png + +feh -B white --bg-max /tmp/bg.png + |