> On Tue, Dec 12, 2000 at 08:50:17AM -0800, Heather wrote:
> > 
> > My favorite trick is to wire "keyboardsignal" (usually, alt-up) to run a
> > script which invokes the dock's modules for me.
> 
> Could you expand on this, please?

Sure.  /etc/inittab has a line which usually does something useless like
        "echo Keyboard Signal -- edit /etc/inittab to make this work"

It can be told to run any script you want, really.

Anyways "keyboard signal" is generated by Alt-UpArrow, if you're on the
default keymap.  If you like messing with keymaps you could assign it to
one of the window-keys, I suppose...

> I just bought a Tecra 720CDT and DeskStation V+ docking station.  I can 
> dock/undock without powering down the laptop, but I need to work on some 
> scripts for enabling/disabling the devices in the dock. Any additional 
> details of your setup would be appreciated.  Thanks!

Well, as soon as you determine which modules make the gadgets happy when
it's docked, then you can do this trick.  Have the script toggle a lockfile.
(call if /var/lock/docked or something like that.)  If the script sees the
lockfile, unload the applicable modules, do anything you like to do afterwards
like stop networky things or whatever, and unlock it.  If the script doesn't 
see the lockfile, it should (obviously) do the reverse... load the modules,
do anything you prefer to have going while docked, and mark the dock locked.  

The only hard part is it probably can't detect that the dock is on or not,
so you'll have to use alt-Up to tell it so.  If, in your case, you can
have some trick to spot it (perhaps lspci only sees a given device when the
dock is attached?) then you might even be able to make it smarter.

I used it to load up an ethernet interface... /etc/network/interfaces setup
as "noauto" for this one, with pre and post entries (pleeeease check exact 
spelling of the keywords) to load its module before configuring the interface, 
and unload the module after deconfiguring the interface.  With a script like 
above, I didn't have to remember "is that ifup eth0 or ifdown eth0?" -- it can 
either look at the module list and do The Other Thing, or it can use the lock 
trick -- and all its owner had to do is press alt-Up.  Dock, undock.  easy.

I had conceived of making the script I call be a scheme-control widget.
I bet it wouldn't be that hard, I just never got around to it.

In my *own* setup, this doesn't apply; the Magio has a full set of ports
and never had any need for a dock... just card services for my ethernet.

* Heather Stern * star@ many places...

Reply via email to