Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
window manager select script not working
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
irony
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jul 2002
Posts: 129
Location: CT

PostPosted: Thu Jul 25, 2002 1:01 am    Post subject: window manager select script not working Reply with quote

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
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Thu Jul 25, 2002 1:20 am    Post subject: Reply with quote

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
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Jul 25, 2002 1:51 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum