#!/bin/bash # # install SUSE theme # install_suse_theme () { setstyle --no-fonts /usr/share/WindowMaker/Themes/SUSE.themed } # # update root menu # HOME_GNUSTEP=${GNUSTEP_USER_ROOT:-$HOME/GNUstep} ROOT_MENU=$HOME_GNUSTEP/Defaults/WMRootMenu WM_CONFIG=$HOME_GNUSTEP/Defaults/WindowMaker test -f $ROOT_MENU && \ grep -q /etc/WindowMaker/SuSE/SuSE_menu $ROOT_MENU && { cp $ROOT_MENU $ROOT_MENU.bak && \ sed -e 's|"/etc/WindowMaker/SuSE/SuSE_wmapps[^"]*"|"/etc/X11/WindowMaker/SuSE_wmapps"|g' \ -e 's|"/etc/WindowMaker/SuSE/SuSE_menu[^"]*"|"\| xdg_menu --format WindowMaker --charset UTF-8"|g' \ $ROOT_MENU.bak >$ROOT_MENU } for FILE in $HOME_GNUSTEP/Defaults/* ; do [ $FILE = ${FILE%.sav} -a $FILE = ${FILE%.bak} -a -f $FILE ] && \ grep -q /GNUstep/Apps/ $FILE && { cp $FILE $FILE.bak && \ sed -e 's|/GNUstep/Apps/|/GNUstep/Applications/|g' $FILE.bak >$FILE } done # # initialize users resources if any # test -f $WM_CONFIG || { wmaker.inst install_suse_theme test $? = 0 || exit 1 } # # replace the old suse theme # grep -q "/usr/X11R6/share/WindowMaker/Themes/SuSE.themed/stripes.png" $WM_CONFIG && grep -q "/usr/X11R6/share/WindowMaker/Themes/SuSE.themed/blau.png" $WM_CONFIG && install_suse_theme grep -q "/share/WindowMaker/Themes/SuSE.themed/SUSE.jpg" $WM_CONFIG && install_suse_theme # # handle transition from /usr/X11R6 # find_X11R6 () { find $HOME_GNUSTEP -name "*.bak" -o -name "*.sav" -prune -o -type f -exec grep -q "/usr/X11R6/\(share/WindowMaker\|GNUstep\)" {} \; -print } if [ -f $ROOT_MENU ] && grep -q /usr/X11R6/GNUstep/Applications/WPrefs.app/WPrefs $ROOT_MENU && \ [ ! -f /usr/X11R6/GNUstep/Applications/WPrefs.app/WPrefs -a ! -f /usr/X11R6/share/WindowMaker/README ] && \ [ "x`find_X11R6`" != x ]; then xmessage -buttons "Keep:1,Update:0" -file - <$FILE done fi fi # # let xdg_menu cache the output # xdg_menu --format WindowMaker --charset UTF-8 >/dev/null 2>&1 & exec wmaker