I haven't tried this with 11.04 and I don't think I ever will because I just don't like it and find it very buggy.
Originally Posted by pete78
To debug this run the bellow command and undock to see what you get:
And see if the event you get when pressing the undock button matches your rule.
udevadm monitor --environment
In my case when I press the undock button I get:
And you can see how this matches the rule:
KERNEL[1307629733.862912] change /devices/platform/dock.0 (platform)
Bear in mind I'm doing this on 10.04 and a Thinkpad W500.
KERNEL=="dock.0", ACTION=="change", RUN+="/etc/thinkpad/dock.sh"
I hope this helps.