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

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

reply to topic new topic new poll
Topic: Load my way< Next Oldest | Next Newest >
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: May 25 2005,11:46 QUOTE

adssse, The .xinitrc is the startup file for X windows.  It's a shell script with a list of programs to run when X windows starts, and the last line is the windows manager (fluxbox or in some cases ion or twm).  Here's the one that comes with dsl:

Code Sample
# put X windows programs that you want started here.
# Be sure to add at the end of each command the &
if egrep -qv noicons /proc/cmdline 2>/dev/null; then
 enhance &>/dev/null &
fi
dillo /usr/share/doc/dsl/getting_started.html &>/dev/null &
fluxbox 2>/dev/null


The first two lines are comments.  A comment line starts with a # character.  Use as many comments as you want to.

The third line is the beginning of an "if" statement.  If the statement is true, then it runs the line below it until the "fi" which ends the if statement.  This particular if statement runs grep (a pattern matcher) to look in the file /proc/cmdline for the absense of the word "noicons."  /proc/cmdline holds the text you typed at the boot: prompt.

The fourth line is an example of a program to run.  This program (enhace) happens to be a shell script.  It contains a bunch of dock apps to load.  Notice the &>/dev/null &.  The &>/dev/null part sends any text output from the program being run to /dev/null, effectively throwing it away.  The & at the end runs this program in the background.  In other words, it goes on with the next command even if the command you put in the background is still running instead of waiting for it to finish.

Line 7 starts up dillo, the web browser.  You could start anything you know you want running when you start X windows, say beaver or Firefox.  Give whatever command line arguments you need and make sure to end the line with a &>/dev/null &

Line 8 starts fluxbox, which is the X windows manager we use.  X draws on the screen and handles the low level graphics details; fluxbox handles what windows look like, how they move, and how they are controlled.  The last line doesn't get the & at the end of it.

The .xinitrc I showed you was much simpler, just a list of files and a window manager (fluxbox) at the end.  You can make an .xinitrc far more complex that either of these if you want to using bash scripting commands.
Back to top
Profile PM 
adssse Offline





Group: Members
Posts: 505
Joined: Mar. 2005
Posted: May 25 2005,13:09 QUOTE

Thanks for the explanation clacker, I really appreciate you taking the time to explain this. I think I understand it quite a bit better now.
Back to top
Profile PM 
pradi Offline





Group: Members
Posts: 17
Joined: Mar. 2005
Posted: May 28 2005,01:13 QUOTE

It is so useful for me ,NB. Thanks so much.
Back to top
Profile PM 
7 replies since May 24 2005,21:01 < Next Oldest | Next Newest >

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

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: Load my way

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