blackbox, bbkeys, and .xinit... (solved) --> UNIX behind the scenes

Mike Hauber m.hauber at mchsi.com
Wed Nov 3 14:36:44 PST 2004


On Wednesday 03 November 2004 03:48 am, Eric Kjeldergaard 
proclaimed:
> On Tue, 2 Nov 2004 18:55:51 -0500, Mike Hauber 
<m.hauber at mchsi.com> wrote:
> > Greets,
> >
> > This is something I haven't had to mess with before,
> > and I'm confused by the docs...
> >
> > I have several WMs installed on my FreeBSD (4.10)
> > desktop, one of which is blackbox.  Is there a way to
> > uniquely state that if blackbox loads, then bbkeys
> > should load as well?
> >
> > The instructions say to add the command to my ~/.xinit
> > file, but if I do that, then bbkeys will load with
> > whatever I start (If I understood it correctly.  Like I
> > said, I've not had to do this before).
> >
> > Oh yeah...  I'm running KDM from /etc/ttys at startup
> > (if that matters).
>
> Well, you could do the following (which is dirty, but
> popped into my head)
>
> if (ps | grep blackbox | grep -v grep > /dev/null); then
> bbkeys; fi

Thanks for the reply, Eric.  That was pretty much my initial 
idea, but it would be something that would always have to 
be running...  Not that I'm _that_ short on resources, just 
thought there should be a cleaner way of doing it.

I've written a simple script to run blackbox and bbkeys 
using the ampersand, and then pointed blackbox.desktop to 
the script.  

I discovered that with the line "blackbox & bbkeys" in the 
script, the bbscript remains when I exit blackbox, and I 
have to close bbscript to return to KDM. That would lead me 
to believe that the two binaries run independant of each 
other (makes sense).  

However, when I login and close bbkeys, then blackbox 
abruptly closes (apparently a clean kill), and I return to 
KDM.  So much for the binaries running independantly.  I 
don't understand why.

I've also discovered that the ampersand doesn't seem to 
_really_ mean that binaries are run simultaniously, so that 
would mean the second binary is actually started on a 
succeeding clock cycle?  kinda makes sense.

Then I switched the line in the script to read "bbkeys & 
blackbox"  Now, when I exit blackbox, bbkeys goes away as 
well.  I don't see it when I 'ps -xa', I don't see multiple 
instances when I log back in, and I don't see any core 
dumps.  Therefore I have to assume that this is also a 
clean kill (which is okay with me, but I still don't 
understand why).

Obviously the ampersand is not FreeBSD specific, but *NIX in 
general so I've googled around and searched some generic 
UNIX sites/tutorials, but haven't found anything explaining 
how it really works (beyond saying that it's used to run 
binaries "simultaneously").  

I'd like to learn more, but I'm not sure where to begin.  If 
it's the hardware that I'm needing to understand better, 
then I would _like_ to avoid starting at the "this is a 
NAND gate" level.  Any recommends?

Thanks,

Mike


More information about the freebsd-questions mailing list