#!/bin/sh OTHER_CONFIG_FILE="XF86Config-dual" X_PATH="/usr/X11R6/bin/X" OTHER_STARTX="startx -- $X_PATH -xf86config $OTHER_CONFIG_FILE" case $1 in -h) echo echo "usage: wm [-h] [kgiw] [2]" echo " -h: display this help" echo " k: kde, g: gnome, i: icewm, w: wmaker" echo " 2: start in dual mode" echo echo "examples:" echo " \$ wm i 2 => start icewm in dual mode" echo " \$ wm k => start kde in normal mode" echo " \$ wm 2 => start the last used window manager in dual mode" echo echo "You must always give the \"2\" argument *after* the window manager argument." echo exit;; 2) exec $OTHER_STARTX exit;; esac if [ "$2" = "2" ] then STARTX=$OTHER_STARTX else STARTX=startx fi WM=$1 case $WM in "k"|"kde") echo "startkde" > ~/.xinitrc exec $STARTX;; "g"|"gnome") echo "exec gnome-session" > ~/.xinitrc exec $STARTX;; "i"|"icewm") echo "exec icewm" > ~/.xinitrc exec $STARTX;; "w"|"wmaker") echo "exec wmaker" > ~/.xinitrc exec $STARTX;; # si aucun argument, le dernier WM lancé est lancé avec le fichier # de conf par défaut * ) exec $STARTX;; esac