View previous topic :: View next topic |
Author |
Message |
irony Tux's lil' helper
Joined: 10 Jul 2002 Posts: 129 Location: CT
|
Posted: Thu Jul 25, 2002 1:01 am Post subject: window manager select script not working |
|
|
From what I understand, .xinitrc is just a shell script. What I'd like to be able to do is just type "startx gnome" or "startx kde" in order to start different window manager apps when I start X. My problem seems to be that the command startx isn't recognizing the "gnome" or "kde" part as the argument $1, so I get the error message "bad command option "gnome"".
I've seen other scripts use $1 to reference the first argument in a similar manner...any suggestions?
Code: |
#!/bin/bash
defaultwm=kde
#set the window manager to $1 if it was supplied
WM=${1:-$defaultwm}
#start the window manager of choice
case ${WM} in
kde)
wm=startkde
;;
gnome)
wm=gnome-session
;;
fluxbox)
wm=fluxbox
;;
*) wm=kde # in case they type something funny
esac
exec $wm
|
_________________ "and if rain brings winds of change, let it rain on us forever..." |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Thu Jul 25, 2002 1:20 am Post subject: |
|
|
Try:
Code: |
startx ~/.xinitrc gnome
|
or
Code: |
startx ~/.xinitrc kde
|
This works. If you have client args, you need to provide a client name to startx. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Thu Jul 25, 2002 1:51 am Post subject: |
|
|
Naan Yaar wrote: | Try:
Code: |
startx ~/.xinitrc gnome
|
or
Code: |
startx ~/.xinitrc kde
|
This works. If you have client args, you need to provide a client name to startx. | Perhaps an alias of Code: | alias sx='startx ~/.xinitrc' | would save some typing.
That should allow for sx gnome or sx kde _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
|