WindowMakerThemes

Note: You are viewing an old revision of this page. View the current version.

The WindowMaker window manager has a theme mechanisim which controls your background images, titlebar images, etc. This is controlled with the setstyle program.

I wrote the following script to invoke setstyle and give it a random theme:

 #!/usr/bin/tcl
 # A script to randomly select a new windowmaker theme.

 set dir "~/GNUstep/Library/WindowMaker/Themes"
 set styleprog /usr/local/bin/setstyle

 set themelist [ readdir $dir ]

 # Pick a random theme from the list.
 random seed
 set picknum [ random [ llength $themelist ] ]
 set theme [ lindex $themelist $picknum ]

 #echo "theme is $theme"

 if [ file exists "$dir/$theme" ] {
    set result [system $styleprog $dir/"$theme"]
    if [ expr $result != 0 ] {
      echo "$styleprog failed!"
      echo "Theme was $dir/$theme"
      exit 1
    }
    exit 0
 } else {
    echo "Can't find theme $dir/$theme! Where did it go?"
    exit 1
 }

So throw that in a cronjob and you get a new random theme every half-hour. Pretty cool.

--phil 3/7/02



Our Founder
ToolboxClick to hide/show
RecentChanges Click to hide/show