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
Pages: (3) </ [1] 2 3 >/

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

reply to topic new topic new poll
Topic: XFree86.dsl automated script for 2 different pc's, cp .xserverrcGforce ~/.xserverrc< Next Oldest | Next Newest >
Patrick Offline





Group: Members
Posts: 333
Joined: Sep. 2004
Posted: Dec. 25 2004,18:25 QUOTE

Hello yall,

I am using Xfree86.dsl and it works great. (great job Henk!) Now i need to make a script  (or two) that i can run when i use my usb-stick on a different PC.

First line of this script:

install Xfree86.dsl (i don't know the command to do this)

Got the second line down already:

cp .xserverrcGforce ~/.xserverrc (or) cp .xserverrcX ~/.xserverrc (i use my stick on 2 pc's, one with a Gforce 4 mx videocard and one with a intel videocard (onboard)

Third line:

After copying/changing the .xserverrc i need to exit x/Xfree and go back to the new xserver. I haven't figured out yet how to put this in a script...

Do you know?


--------------
Usb-stick sandisk cruzer titanium 512 Mb:
DSL 2.3 (final)
Firefox (Mozilla 1.06)
WM -biff  -cdplay -clockmon -smixer -usic -top -net -biff -ifinfo -cpuload
gps vnc LinNeighborhood (samba) QtParted bdc
xawtv imagemagick xplanet
Back to top
Profile PM WEB 
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: Dec. 25 2004,18:55 QUOTE

Patrick:

The command to work for your " install XFree86.dsl would be...

mydsl-load XFree86.dsl

73
ke4nt
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Dec. 25 2004,20:38 QUOTE

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
Back to top
Profile PM WEB 
Patrick Offline





Group: Members
Posts: 333
Joined: Sep. 2004
Posted: Dec. 26 2004,08:39 QUOTE

I am doing something wrong...
**********************************************
#!/bin/bash
mydsl-load /mnt/hdb8/XFree86.dsl
ARG="$1"
case $ARG in
g|gforce|G|Gforce)
rm ~/.xserverrc
cp /cdrom/keep/scriptjes/.xserverrcGforce ~/.xserverrc
;;
x|X)
rm ~/.xserverrc
cp /cdrom/keep/scriptjes/.xserverrcX ~/.xserverrc
;;
*)
echo "please specify g or x"
exit 0
;;
esac
exec startx
*****************************************************

This script is called "go" and is in my /home/dsl

It doesn't run right (yet)


Any tips?


--------------
Usb-stick sandisk cruzer titanium 512 Mb:
DSL 2.3 (final)
Firefox (Mozilla 1.06)
WM -biff  -cdplay -clockmon -smixer -usic -top -net -biff -ifinfo -cpuload
gps vnc LinNeighborhood (samba) QtParted bdc
xawtv imagemagick xplanet
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Dec. 26 2004,15:37 QUOTE

I don't know yet.  I know that busybox has some different tools than gnu-utils, and as a result I sometimes need to modify my scripts even if they work fine on another system.

Could be rm is failing for some reason.  I'd use 'cp -f' instead.  Or it could be a syntax error that I just don't see.

Are you getting any error messages?  That would help a lot.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
11 replies since Dec. 25 2004,18:25 < Next Oldest | Next Newest >

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

Pages: (3) </ [1] 2 3 >/
reply to topic new topic new poll
Quick Reply: XFree86.dsl automated script for 2 different pc's

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