#! /bin/bash # gets the themes in a backup subdirectory, adjusts them # for 8bpp, leftjustify, background as darkslategrey # and recreates the stylesmenu # # Satheesh Babu # vsbabu@bcsoft.net # # directory where adjusted themes and the styles menu file are stored bbstyledir=/usr/X11R6/share/Blackbox/themes/Styles # where original styles are stored thmdir=$bbstyledir/Bak stylesmenufile=$bbstyledir/stylesmenu # how many theme entries in a group themesingroup=12 # I don't like huge images. Anyway, change this to whatever you like RootCmd='rootCommand: /home/httpd/html/www/blackbox/SetWallP' # --------- nothing to change below --------------------------------- currthm=0 currgroup=1 echo "[submenu] (Styles $currgroup) {Choose style}" > $stylesmenufile for fil in $thmdir/* do tgt=`basename $fil` tgt=`echo "$bbstyledir/$tgt"` sed -e 's/CenterJustify/LeftJustify/g' \ -e 's/RightJustify/LeftJustify/g' $fil|grep -vi rootcommand > $tgt #-e 's/Horizontal//g' \ #-e 's/Vertical//g' \ #-e 's/Diagonal//g' \ #-e 's/Gradient/Solid/g' \ echo "$RootCmd" >> $tgt # uppercase the first letter for menu name menuname1=`basename $tgt|cut -c1|tr [a-z] [A-Z]` menuname2=`basename $tgt|cut -c2-` menuname=`echo "$menuname1$menuname2"` # keep count currthm=`expr $currthm + 1` if [ $currthm -gt $themesingroup ] then currthm=0; echo "[end]" >>$stylesmenufile currgroup=`expr $currgroup + 1` echo "[submenu] (Styles $currgroup) {Choose style}"\ >>$stylesmenufile fi echo "[style] ($menuname) {$tgt}"\ >> $stylesmenufile echo "$currgroup -> $menuname" done echo "[end]">>$stylesmenufile-->