Friday, December 17, 2010

OpenBSD NC4200: Another rough tweak for xdm with multiple window manager.

After reading Gentoo Wiki I found another way to get xdm to let you choose desired window manager. This is rougher than the previous tweak I posted. For this one, I need to edit 3 files.

Step 1: Edit /etc/X11/xdm/Xresources.
I edited the file with these values:

xlogin*login.translations: #override \
   *default bits ignored*
   <Key>F1: set-session-argument(failsafe) finish-field()\n\
   <Key>F2: set-session-argument(fvwm) finish-field()\n\
   <Key>F3: set-session-argument(xfce4) finish-field()\n\

   *default bits ignore*


The bolded parts are the values I inserted.


Step 2: Edit /etc/X11/xdm/Xsession.
I edited the file with these values:

case $# in
1)
   case $1 in
   *default bits ignored*
   fvwm)
      xscreensaver -no-splash &
      nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
      eval `cat ~/.fehbg`
      exec fvwm
      ;;
   xfce4)
      exec startxfce4
      ;;

   esac
esac


Like Step 1, bolded parts are the values I inserted. Basically these 2 steps will tell xdm to load fvwm if I press F2 after I type my username and password or load xfce4 if I press F3 after I type my username and password. Eh, what about my fav-o-win-manager wmii?. Ahh. For that one I need to go to Step 3.


Step 3: Edit ~/.xsession.
This one is the long one. Trust me if I know a shorter way I would put it here. For this I edit:

xscreensaver -no-splash &
nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
eval `cat ~/.fehbg`
exec wmii


Gotcha! Ho boy I love to do that. Well it's basically very short. So now if I press Return (Enter) key after I type my username & password, wmii will load. Personally, I prefer the previous tweak I posted earlier because I don't need to edit a few files. For previous tweak, I will know which window manager I will choose but for this tweak, I have to memorize which F* key will load which window manager.

Sure, SLiM looks prettier but xdm comes with X11 by default. Later.

No comments: