Showing posts with label window manager. Show all posts
Showing posts with label window manager. Show all posts

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.

OpenBSD NC4200: Back to xdm, using rough hack to change window manager.

Ah. Now I'm back to using xdm as my login manager. Using Wikibook's Guide to X11 as a guideline, I managed to write a rough hack to let me choose my desired window manager in xdm.

Step 1: Disable SLiM login manager.
I use /etc/rc.local to start SLiM as the login manager so I just comment the SLiM's related entries.


Step 2: Enabling xdm.
I edit /etc/rc.conf.local and put:

xdm_flags=""


Step 3: Tweak xdm for multi window manager.
This one is a rough hack. I opened ~/.xsession and edit it with this:

# Variables for choosing window manager.
managers=wmii,xfce4,fvwm
prompt="Welcome $USER, select window manager:"

# Selecting window manager.
manager="$(xmessage -buttons "$managers" -print -center -timeout 4 "$prompt")"

case $manager in
wmii)
   xscreensaver -no-splash &
   nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
   eval `cat ~/.fehbg`
   exec wmii
   ;;
xfce4)
   startxfce4
   ;;
fvwm)
   xscreensaver -no-splash &
   nohup sh ~/davmail.davmail.sh ~/davmail/davmail.properties &
   eval `cat ~/.fehbg`
   exec fvwm
   ;;
*)
   xscreensaver -no-splash &
   nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
   eval `cat ~/.fehbg`
   exec wmii
   ;;
esac


Take note that the xscreensaver, davmail & .fehbg bits depends on whether you need it or not. So after I type my login name and password, a dialog box appears and request me to choose the desired window manager to load. If I don't click any button in 4 seconds, wmii will load.

As this is a rough hack, there's issue with it. Currently after loading fvwm, I can't see the text on the exit confirmation box when I want to quit fvwm. Hmm it seems that most of the time, it's working fine. If you have any idea, do comment. I will greatly appreciate it. Later

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...