mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Dec. 25 2004,20:38 |
|
You could add 'killall fluxbox' and 'startx', but that's kinda messy in my opinion. What I'd do is remove 'startx' from .bash_profile, and put it at the end of your script instead. With this method you'll boot to a console. Since you plan to shut down fluxbox right after it starts, you're better off just waiting to start it until after xfree is installed.
One script is enough, by the way. You can pass an argument to it which it uses to decide which xserverrc to use. Something like this should work:
Code Sample | ARG="$1" case $ARG in g|gforce|G|Gforce) cp ~/.xserverrcGforce ~/.xserverrc ;; x|X) cp ~/.xserverrcX ~/.xserverrc ;; *) echo "please specify g or x" exit 0 ;; esac exec startx
|
You'd start it with 'scriptname x' or 'scriptname g'
Another thing you can do is put the contents of your rc files into the script rather than backing up and restoring 2 additional files. With this method you'd use echo or cat with a redirect rather than using cp. Something like this:
Code Sample | case $ARG in g|gforce|G|Gforce) echo "contents of Gforce file" > $HOME/.xserverrc ;;
|
or
Code Sample | case $ARG in g|gforce|G|Gforce) cat << EOF > $HOME/.xserverrc Some stuff to put in xserverrc. more stuff. it will copy everything until it reads this: EOF ;;
|
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|