From c966a7bb95242f5a53ff161b53ac8dab56eba012 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 8 Apr 2016 10:42:37 +0200 Subject: Reorganised bg stuff --- bin/setbg | 23 +---------------------- bin/setbg-pgfplots | 22 ++++++++++++++++++++++ bin/setbg-texample | 29 +++++++++++++++++++++++++++++ bin/setbg2 | 29 ----------------------------- 4 files changed, 52 insertions(+), 51 deletions(-) mode change 100755 => 120000 bin/setbg create mode 100755 bin/setbg-pgfplots create mode 100755 bin/setbg-texample delete mode 100755 bin/setbg2 (limited to 'bin') diff --git a/bin/setbg b/bin/setbg deleted file mode 100755 index 7343f35..0000000 --- a/bin/setbg +++ /dev/null @@ -1,22 +0,0 @@ -#!/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" - diff --git a/bin/setbg b/bin/setbg new file mode 120000 index 0000000..d445e5c --- /dev/null +++ b/bin/setbg @@ -0,0 +1 @@ +setbg-texample \ No newline at end of file diff --git a/bin/setbg-pgfplots b/bin/setbg-pgfplots new file mode 100755 index 0000000..7343f35 --- /dev/null +++ b/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" + diff --git a/bin/setbg-texample b/bin/setbg-texample new file mode 100755 index 0000000..3721944 --- /dev/null +++ b/bin/setbg-texample @@ -0,0 +1,29 @@ +#!/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" + +PAGE=$RANDOM; let "PAGE %= 22"; let "PAGE += 1" + +cd /tmp +wget -qO texample.html "http://texample.net/tikz/examples/all/?page=$PAGE" +EXAMPLES="$(grep '^PDF<\/a>.*/\1/")" +TEX="$(grep '\/media\/tikz\/examples\/TEX' texample.html | grep -v writelatex | sed "s/.*TEX<\/a>.*/\1/")" + +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 + +montage -geometry "+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg.png "/tmp/bg-$PAGE.png" +rm /tmp/bg{,-src}.png + +feh -B white --bg-max "/tmp/bg-$PAGE.png" + diff --git a/bin/setbg2 b/bin/setbg2 deleted file mode 100755 index 3721944..0000000 --- a/bin/setbg2 +++ /dev/null @@ -1,29 +0,0 @@ -#!/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" - -PAGE=$RANDOM; let "PAGE %= 22"; let "PAGE += 1" - -cd /tmp -wget -qO texample.html "http://texample.net/tikz/examples/all/?page=$PAGE" -EXAMPLES="$(grep '^PDF<\/a>.*/\1/")" -TEX="$(grep '\/media\/tikz\/examples\/TEX' texample.html | grep -v writelatex | sed "s/.*TEX<\/a>.*/\1/")" - -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 - -montage -geometry "+$PADDING+$PADDING" /tmp/bg-src.png /tmp/bg.png "/tmp/bg-$PAGE.png" -rm /tmp/bg{,-src}.png - -feh -B white --bg-max "/tmp/bg-$PAGE.png" - -- cgit v1.2.3