Help With Docking Station Script, and Udev rules
Hello everyone, I am hoping someone can help me with a script as well as udev rules. I am also hoping the solution to this can be helpful others, since docking stations can be a pain.
Anyway, here is a script I wrote after Googling for a while: Code:
#!/bin/sh I also wrote a udev rule, hoping that I can automate this: Code:
# Rules for docking / undocking Unfortunately, that does not work. I still have to switch the output manually. Any idea what I may have done wrong? I never wrote a udev rule before. Edit: I totally forgot to mention, this is on a Latitude D630. I'll be setting this type of thing up on a Latitude E6410 when I get it sorted out. |
I have no personal experience with this, but to hazard a guess, I believe udev scripts run as root, which is generally not the user that owns the x session. Perhaps some use of su/sudo would help.
Another possibility may be to use something like halevt instead. http://www.nongnu.org/halevt/ There are probably better ways to do it though. |
udev responds to entries somewhere in the /sys directory .
You could need to have to `echo 'dock' > /sys/path/of/driver/uevent` . The Puppy boot script /etc/rc.d/rc.sysinit uses `echo 'ADD'` to load the autodetected drivers at boot . As far as I could observe this , the /sys/.../uevent file gets automatically restored afterwards . If you add a `cat /sys/.../uevent` before and after the `echo 'ADD' > /sys/.../uevent` you would see no difference . |
All times are GMT -5. The time now is 02:13 AM. |