[ltp] Re: How does a uevent work for dock/undock on thinkpads?
Stefan Monnier
linux-thinkpad@linux-thinkpad.org
Sun, 08 Feb 2009 15:55:56 -0500
> I know nothing about udev or HAL. Is there a simple way to do what
> I want to do? I would appreciate if anyone could give any help
> or direction.
It should be possible to write a simple file to put into
/etc/udev/rules.d that will run your script whenever you dock or undock.
The problem is to figure out what these events look like so you can
write rules that match.
A first step might be to add a /etc/udev/rules.d/00-trace.rules
that just contains:
NAME==".*", RUN+="printenv | logger -t udevd"
this will spam your syslog with a lot of info about each and every
udev event. Then you can look for the ones that correspond to
docking&undocking.
Stefan