From 65223eb4555e7f2a5b64c20f4df19a79cc4f0013 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 6 Apr 2016 22:17:29 +0200 Subject: pgfplot example as background --- bin/setbg | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/setbg b/bin/setbg index 805cb9e..1eacbd3 100755 --- a/bin/setbg +++ b/bin/setbg @@ -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 + -- cgit v1.2.3