Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: startx <args>, passing parameters to xinit< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 01 2005,04:35 QUOTE

One thing I've found somewhat frustrating is that the startx script in DSL doesn't seem to allow passing of parameters to xinit. This is a simple feature that seems to be standard in many distros (the 4 or 5 that I've used anyway).  For example, a user could add something like this in .xinitrc:
Code Sample
if [ -n "$@" ]; then
WM="$@"
else
WM=fluxbox
fi
exec $WM &>/dev/null

Then he could "startx <something>" and <something> would be launched as the window manager.

As it is, though, there seems to be no simple way of picking an arbitrary window manager without a wrapper that either calls a separate xinitrc script (and bypasses startx), or replaces/edits the current .xinitrc.  The concept of changing the .xinitrc manually is a simple and standard one, but so is the concept of freedom of choice and customization.

As far as I know, the only change needed would be allowing the startx script to pass params on to xinit, but I haven't fully studied the other startx scripts to compare with the one in DSL.

EDIT: I'm pretty sure that the current setup can be used to grab the window manager from the boot line, but it would be extremely convenient to be able to do this from the console as well.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 01 2005,14:09 QUOTE

After staring at the ceiling for a while trying to sleep, it occurred to me that it can already be accomplished easily enough, even though it's not the "typical" way to which I'm accustomed.
1) In .xinitrc, replace "fluxbox" with "$WINDOWMANAGER"
2) Make a function in .bash_profile:
startx() {
if [ -n "$*" ]; then
export WINDOWMANAGER="$*"
else
export WINDOWMANAGER=fluxbox
fi
/usr/X11R6/bin/startx
}
3) Exit X and then source .bash_profile.
4) Use the startx command as usual.

I'm not entirely sure the syntax is correct, but the concept should work with a minimal amount of tweaking.

EDIT: Made some minor adjustments after actually testing it.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
1 replies since Sep. 01 2005,04:35 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: startx <args>

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code