Wikia

Sawfish

Theme screenshots

773pages on
this wiki
Talk0

An automatic screenshot generator is currently included in sawfish 1.3.1 tarball

See also notes by Sven on his user page about automatic uploading.

Screenshot auto generationEdit

We are experimenting with a script that will automatically make screenshots of over 300 themes. Here's an example, with a broken theme:

Theme Example
Example

A "standarized" windows layout we can use in our scripts, can be something like that (eg. call this file banner.sh):

#!/bin/bash
xterm -geom 34x16+380+10 -T Title-only -bg darkgray -fg darkgreen \
   -e /bin/bash -c "cowsay \"A title only window\" ; sleep 20" &
sleep 0.5
xterm -geom 34x10+380+285 -T Top-border -bg blue -fg yellow \
   -e /bin/bash -c "cowsay \"A top border window\" ; sleep 20" &
sleep 0.5
xeyes -geom 180x100+420+137 &
sleep 0.5
xclock -render -geom 135x135+430+355 &
sleep 0.5
xterm -geom 47x10+5+285 -T Border-only \
   -e /bin/bash -c "cowsay \"A border only window\" ; sleep 20" &
sleep 0.5
xterm -geom 34x10+55+340 -T Shaded -bg red -fg yellow \
   -e /bin/bash -c "cowsay \"Eeeek! A Shaded window!\" ; sleep 20" &
sleep 0.5
xterm -geom 47x16+5+5 -T Normal -bg black -fg lightgray \
   -e /bin/bash -c "cowsay Theme \'$1\' README is below. \
   This window has focus. ; sleep 20" &

It is prepared for screenshot size 640x480, and needs a modification: a `cat README` in right place. We will get to this point later.

So to make it all work we need to use another user, to avoid messing with sawfish config. We need to generate sawfish config file /home/test/.sawfish/custom depending on $THEME. So use this bash script for that (I called it prep_config.sh):

#!/bin/bash
echo
echo Theme to test: "$1"
echo
# Edit this script to remove that stupid confirmation.
echo Really delete ~/.sawfish/custom and ~/.sawfishrc for theme testing?
echo -n "Make sure you don't delete something important! (enter 'n' to abort) : ";
read x; if [ "$x" = "n" ]; then exit; fi

rm ~/.sawfishrc
rm -rf ~/.sawfish/custom

echo "(custom-set-typed-variable (quote default-frame-style) (quote $1) \
(quote frame-style))" > ~/.sawfish/custom
echo "(custom-set-typed-variable (quote match-window-profile) \
(quote ((((WM_NAME . \"^Normal\$\")) (frame-type . normal)) (((WM_NAME . \"^Shaded\$\")) \
(shaded . #t)) (((WM_NAME . \"^Title-only\$\")) (frame-type . title-only)) \
(((WM_NAME . \"^Border-only\$\")) (frame-type . border-only)) \
(((WM_NAME . \"^Top-border\$\")) (frame-type . top-border)) (((WM_NAME . \"^None\$\")) \
(frame-type . none)))) (quote match-window) \
(quote sawfish.wm.ext.match-window))" >>  ~/.sawfish/custom


Now, when this script is exectued, sawfish will use desired theme, so next we do something along this line:

ssh test@localhost -X
Xnest -ac :4 -geometry 640x480 &
export DISPLAY=:4
display -window root -size 256x256 xc:grey50
./prep_config.sh $THEME
sawfish &
./banner.sh $THEME
import -window root -quality 85 $THEME.jpg

If I use basic as $THEME it looks like this: theme "Basic":

Basic

Around Wikia's network

Random Wiki