summaryrefslogtreecommitdiff
path: root/docs/tools
diff options
context:
space:
mode:
authormarco giusti <marco.giusti@gmail.com>2011-12-07 12:09:48 +0100
committermarco giusti <marco.giusti@gmail.com>2011-12-07 12:09:48 +0100
commit95e2b308c96112471a8182aab992335f61eb4fae (patch)
tree9a9b69a719ce44f6982810944268e057aa0746b9 /docs/tools
parentaec2740cc698b5b8c7e59cdcd7ab3a05d12716f9 (diff)
downloadurwid-95e2b308c96112471a8182aab992335f61eb4fae.tar.gz
Generate random classname, small cleanups
--HG-- branch : feature-sphinx
Diffstat (limited to 'docs/tools')
-rwxr-xr-xdocs/tools/compile_pngs.sh8
-rwxr-xr-xdocs/tools/screenshots.sh9
2 files changed, 8 insertions, 9 deletions
diff --git a/docs/tools/compile_pngs.sh b/docs/tools/compile_pngs.sh
index b74cc51..5a77d5f 100755
--- a/docs/tools/compile_pngs.sh
+++ b/docs/tools/compile_pngs.sh
@@ -1,20 +1,20 @@
#!/bin/bash -e
# $1: directory to compile
+# $2: compiler
+
DISPLAYNUM=1
XVFB=$(which Xvfb)
if [ -n $XVFB ]; then
- # Xvfb :$DISPLAYNUM &> /dev/null &
Xvfb :$DISPLAYNUM &
XVFBPID=$!
- # DISPLAY=:1
- sleep 0.5
+ DISPLAY=:$DISPLAYNUM # this still doesn't work
trap "kill $XVFBPID" EXIT
fi
for script in $1/*.py; do
if [ -f "${script}.xdotool" ]; then
- bash screenshots.sh "$script" < "${script}.xdotool"
+ "$2" "$script" < "${script}.xdotool"
fi
done
diff --git a/docs/tools/screenshots.sh b/docs/tools/screenshots.sh
index d6d1f62..7459223 100755
--- a/docs/tools/screenshots.sh
+++ b/docs/tools/screenshots.sh
@@ -3,15 +3,14 @@
# $1: python script to run
# urxvt, xdotool and import are required to run this script
-# this should be pretty unique, but a true random classname is still possible
-# CLASSNAME=$(head -c 6 /dev/urandom | base64)
-CLASSNAME=urwid-screenshot
+CLASSNAME=$(head -c 6 /dev/urandom | base64 | tr -cd [:alnum:])
PYTHON=python
urxvt -bg gray90 -b 0 +sb -name "$CLASSNAME" -e "$PYTHON" "$1" &
RXVTPID=$!
-sleep 0.2
-RXVTWINDOWID=$(xdotool search --classname "$CLASSNAME")
+until RXVTWINDOWID=$(xdotool search --classname "$CLASSNAME"); do
+ sleep 0.1
+done
export RXVTWINDOWID
image=${1%.py}