[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Changing window manager: from metacity to windowmaker



On Sun, Nov 23, 2008 at 5:26 AM, steve <steve lonetwin net> wrote:
> Hi All,
>
> I recently installed F10 (rawhide) and realized that, thanks to docker
> (Thanks Ben Jansens ! ...and thanks also to awjb for packaging this !), I
> can now switch to using windowmaker as my primary desktop environment.
>
> However, since I have become used to some of the things gnome does
> (automounting removable disks, for example), I tried changing gnome's
> default window manager (metacity) to windowmaker. I assumed all that was
> needed to make this happen was changing the key
> /desktop/gnome/session/required_components/windowmanager in gconf-editor.
> Unfortunately, this did not work.
>
> Now, gnome starts up without a window manager ! If I run wmaker from a
> terminal after gnome has started up, it all works fine.
>
> So, my question is, what is the /correct/ way to change gnome's window
> manager ?
>

There are many ways to do this in Fedora 8, maybe you can tell me if
they still work on F10.

The easiest route might be to fix your session.

In Gnome->Preferences->Personal->Sessions, you can take these steps.
1. stop metacity.   change its status from restart to normal, then
remove it from the session. (if you don't change its status, it just
restarts).

2. insert wmaker as a program in the startup list and then save the
settings.  People have claimed that if you have wmaker running and you
just hit the "save session" thing, then it will make it right.  I've
not experienced that myself.

As an alternative, you can go "old school."  Look in your HOME
directory for a file .Xclients.  I think it should be there, it will
have only something like gnome-session.  Before that gnome line, you
cna insert this

export WINDOW_MANAGER=wmaker

There is another file where you can specify the window manager in
Fedora.  I am sure because I had it set that way for a long time to
use wmaker before I took up with compiz.

Several years ago, I wrote a script to do the changeover for users. It
replaces the function of wmaker.inst.   It is called gnome.wmaker.inst
and it uses gconftool to make the session changes for you.  I am not
absolutely sure this is the newest version because I've not worked on
it for a year, but this one did work last time I tried it.  You could
try it. If this does not work, wmail me directly and I'll go to a
Fedora system and make sure it still works for me.  Basically, it
tells gnome to stop bothering the desktop, stops metacity, puts wmaker
in the session, etc.


#!/bin/sh
#
# Install Window Maker for the current user
#

# xx herbert
if test "x$1" = "x--batch" ; then
BATCH="1"
else
BATCH=""
fi
# /xx herbert


#pj
gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop false
#

# name of menu file we install (menu, plmenu)
inst_menu=""

LOCALE=$LANG
if [ -z "$LOCALE" ]; then
LOCALE=$LC_ALL
fi

# directory where system wide configuration is stored
GLOBALDIR="/usr/share/WindowMaker"
GLOBALDEFDIR="/etc/WindowMaker"

USERDIR=$HOME

VERSION="0.92.0"

BINDIR="/usr/bin"

make_dir() {
mkdir $1
chmod +rwx $1
}

make_script() {
ISCRIPT=$1

cat << EOF >> $ISCRIPT
# Window Maker default X session startup script

PATH="\$PATH:$BINDIR"

# If you login from xdm, uncomment this to make error messages appear
# in the console window.
#
# tail -f $HOME/.xsession-errors > /dev/console &

exec wmaker

EOF
chmod +rx $ISCRIPT
}

make_session_starter() {
MYSCRIPT=$1

cat << EOF >> $MYSCRIPT


[Default]
num_clients=1
0,RestartStyleHint=3
0,Priority=50
0,RestartCommand=wmaker
0,Program=wmaker

EOF
}

#
# Copy files considering special cases
#
copy() {
source=$1
target=$2
file=`basename $source`
rm -f $target
if [ "$file" = "WindowMaker" ]; then
sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
elif [ "$file" = "WMRootMenu" ]; then
if [ "$LOCALE" ]; then
if [ -f $GLOBALDIR/plmenu.$LOCALE ]; then
source=$GLOBALDIR/plmenu.$LOCALE
elif [ -f $GLOBALDIR/plmenu.${LOCALE%.*} ]; then
source=$GLOBALDIR/plmenu.${LOCALE%.*}
elif [ -f $GLOBALDIR/plmenu.${LOCALE%_*} ]; then
source=$GLOBALDIR/plmenu.${LOCALE%_*}
elif [ -f $GLOBALDIR/menu.${LOCALE%_*} ]; then
source=$GLOBALDIR/menu.${LOCALE%_*}
else
source=$GLOBALDIR/plmenu
fi
else
source=$GLOBALDIR/plmenu
fi
sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
$source > $GSDIR/Defaults/WMRootMenu
else
if test "x$GNUSTEP_USER_ROOT" = "x"; then
sed -e "s:#wmdatadir#:$GLOBALDIR:g" \
$source > $target
else
sed -e "s|\$HOME/GNUstep|$GSDIR|g" \
-e "s:#wmdatadir#:$GLOBALDIR:g" \
$source > $target
fi
fi
}



echo "Installing WindowMaker $VERSION for current user..."


if [ ! -d $GLOBALDIR ]; then
echo "Could not find global data files"
echo "Make sure you have installed Window Maker correctly"
exit 1
fi

if [ ! -d $GLOBALDEFDIR ]; then
echo "Could not find global configurations files"
echo "Make sure you have installed Window Maker correctly"
exit 1
fi

if [ ! -d "$USERDIR" ]; then
echo "Could not find user directory $USERDIR"
exit 1
fi


if test "x$GNUSTEP_USER_ROOT" = "x"; then
cd $USERDIR
GSDIR=$USERDIR/GNUstep
if [ ! -d $GSDIR ]; then
echo "Creating $GSDIR user directory"
make_dir $GSDIR
fi
else
GSDIR=$GNUSTEP_USER_ROOT
if [ ! -d $GSDIR ]; then
echo "Directory specified in GNUSTEP_USER_ROOT environment
variable does not exist"
exit 1
fi
cd $GSDIR
cd ..
fi


if [ ! -d "$GSDIR/Defaults" ]; then
make_dir $GSDIR/Defaults
fi

echo "Copying defaults database..."

FILES=`(cd $GLOBALDEFDIR;ls -d *)`
all=""
for i in $FILES; do
if [ ! -d $GLOBALDEFDIR/$i ]; then
if [ -f $GSDIR/Defaults/$i -a -z "$BATCH" ]; then
echo "The configuration file \"$i\" already exists in
your defaults database."
echo "Do you wish to replace it? <y/n/a> [n] $all"
if [ "$all" != "a" ]; then
read foo
if [ "$foo" = "a" -o "$foo" = "A" ]; then
all="a"
fi
fi
if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ];
then
copy $GLOBALDEFDIR/$i $GSDIR/Defaults/$i
fi
else
copy $GLOBALDEFDIR/$i $GSDIR/Defaults/$i
fi
fi
done


if [ ! -d "$GSDIR/Library/Icons/" ]; then
echo "Creating icon library directory $GSDIR/Library/Icons"
if [ ! -d $GSDIR/Library ]; then
make_dir $GSDIR/Library
fi
make_dir $GSDIR/Library/Icons
fi


if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
echo "Creating WindowMaker data library directory
$GSDIR/Library/WindowMaker"
if [ ! -d $GSDIR/Library ]; then
make_dir $GSDIR/Library
fi
make_dir $GSDIR/Library/WindowMaker
fi

if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
make_dir $GSDIR/Library/WindowMaker/Styles
fi


if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
make_dir $GSDIR/Library/WindowMaker/Themes
fi


if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
make_dir $GSDIR/Library/WindowMaker/Backgrounds
else
echo "Default Backgrounds directory already exists. Skipping..."
fi


if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
make_dir $GSDIR/Library/WindowMaker/IconSets
else
echo "Default IconSets directory already exists. Skipping..."
fi


if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
make_dir $GSDIR/Library/WindowMaker/Pixmaps
else
echo "Default Pixmaps directory already exists. Skipping..."
fi


if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
make_dir $GSDIR/Library/WindowMaker/Sounds
else
echo "Default Sounds directory already exists. Skipping..."
fi


if [ ! -d "$GSDIR/Library/WindowMaker/SoundSets" ]; then
echo "Creating sound set library $GSDIR/Library/WindowMaker/SoundSets"
make_dir $GSDIR/Library/WindowMaker/SoundSets
else
echo "Default SoundSets directory already exists. Skipping..."
fi


if [ ! -d "$GSDIR/Library/WindowMaker/CachedPixmaps" ]; then
make_dir $GSDIR/Library/WindowMaker/CachedPixmaps
fi

if [ ! -d "$GSDIR/Library/WindowMaker/WPrefs" ]; then
make_dir $GSDIR/Library/WindowMaker/WPrefs
fi

if test -z "" ; then
FILES=`(cd $GLOBALDIR; ls menu menu.* plmenu plmenu.?? wmmacros)`
for i in $FILES; do
# xx herbert
if [ -f "$GSDIR/Library/WindowMaker/$i" -a -z "$BATCH" ]; then
# /xx herbert
echo "The file \"$i\" already exists in
$GSDIR/Library/WindowMaker"
echo "Do you wish to replace it? <y/n/a> [n] $all"
if [ "$all" != "a" ]; then
read foo
if [ "$foo" = "a" -o "$foo" = "A" ]; then
all="a"
fi
fi
if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
copy $GLOBALDIR/$i $GSDIR/Library/WindowMaker/$i
fi
else
copy $GLOBALDIR/$i $GSDIR/Library/WindowMaker/$i
fi
done
fi

cp $GLOBALDIR/README.themes $GSDIR/Library/WindowMaker
cp $GLOBALDIR/README $GSDIR/Library/WindowMaker

test -f ~$GSDIR/Library/WindowMaker/autostart || \
cp $GLOBALDIR/autostart.sh $GSDIR/Library/WindowMaker/autostart
chmod +rx $GSDIR/Library/WindowMaker/autostart

test -f ~$GSDIR/Library/WindowMaker/exitscript || \
cp $GLOBALDIR/exitscript.sh $GSDIR/Library/WindowMaker/exitscript
chmod +rx $GSDIR/Library/WindowMaker/exitscript



# pj
# if there is a metacity running now, kill it and
# try to remove it from the gnome-session

mcpsvalue="";
mcpsvalue=`pgrep metacity`;
if test -n "$mcpsvalue"; then
echo "Trying to kill session"
gnome-session-remove metacity
# kill -9 "$mcpsvalue"
fi

# waiting to make sure session clears
sleep 2



# run wmaker; Is proper to background this?
wmaker &

# pj


# xx herbert
if test -n "$BATCH" ; then
echo "Installation Finished"
exit 0
fi
# /xx herbert


#
#######################

DATE=`date +%b%d.%T`

show_end_message() {

echo
echo "Installation Finished"
echo
if test -z "" ; then
echo "There are menus in 2 different file formats. The plain text format and"
echo "the property list format. The plain text format is more flexible, but"
echo "the menu in the property list format can be edited graphically. The"
echo "menu that will be used by default is the property list one. Read"
echo " $GSDIR/Library/WindowMaker/README"
echo "for information on how to change it."
if [ "${inst_menu%.*}" = "menu" ]; then
echo "However, since you have locale set to $LOCALE and plmenu for such locale"
echo "was not found, your WMRootMenu contains path to text formated menu:"
echo " $GSDIR/Library/WindowMaker/$inst_menu"
fi
else
echo "Your copy of Window Maker is configured especially for KDE."
echo "Window Maker application menus are not available."
fi
}

#wmaker_found=0
#for xinit in .xinitrc .Xclients .xsession; do
# test ! -f "$HOME/$xinit" && continue
# res="`grep wmaker $HOME/$xinit`"
# if test "x$res" != x; then
# wmaker_found=1
# break
# fi
#done
#if test $wmaker_found = 1; then
# echo "Found Window Maker to already be your default window manager."
# show_end_message
# exit 0
#fi

#pj: don't bother looking in .xinitrc, since gnome-session is running.
# just set the default wm and hope it sticks!

gconftool-2 --type=string --set
/desktop/gnome/applications/window_manager/default wmaker

gconftool-2 --type=string --set
/desktop/gnome/applications/window_manager/current wmaker

make_session_starter $HOME/.gnome2/session-manual


echo "When you exit Gnome, be sure to check the box to \"save settings\""
echo "in order to cause Window Maker (\"wmaker\") to be your default"
echo "window manager"


exit 0

trap "show_end_message;exit" 2

#echo
#echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
#echo "it calls wmaker when you start an X session."
#echo "Type the name of the file that must be changed (normally .xinitrc)."
#echo "If the file already exists, it will be backed up with a .old.$DATE "
#echo "extension"
#echo "If you want to edit it by hand, hit <Control>-C now."
#read file

#if test "x$file" = "x"; then
# echo "Using .xinitrc as a default value"
# file=.xinitrc
#fi

#if [ -f $USERDIR/$file ]; then
# mv $USERDIR/$file $USERDIR/$file.old.$DATE
#fi

#make_script $USERDIR/$file

show_end_message



> thanks,
> - steve
>
> --
> fedora-list mailing list
> fedora-list redhat com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
> Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
>



-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]