Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

/edit/

Getting the question more generic:

How can I change the permissions to alter the state of a LED/light using udev?

\edit\


I've got a Thinkpad and would like to use the ThinkLight (the white flash light above the screen designed to light up the keyboard) for notifications on incoming Jabber messages.

It is easy to realise as one only needs to change /sys/class/leds/tpacpi::thinklight/brightness to 255. I'll do it with a simple Bash script, which will let the light blink for three times.

But to be able to do this, I need to change the permissions, that not only root is able to change this file.
And I do not want to sudo chmod o+w /sys/class/leds/tpacpi::thinklight/brightness after each and every boot.

I think, the best solution is using udev for this. However, I've never used udev before and I'm quite confused by the tutorials I found online.

I tried this udev rule:

KERNEL=="tpacpi::thinklight", MODE="0666"

as well as

KERNEL="thinklight", MODE="0666"

But it does not work. Though I'm not getting errors while running udevadm test /class/leds

Thanks for any help and hits. Or maybe other solutions.

share|improve this question

migrated from stackoverflow.com Sep 5 '11 at 10:25

This question came from our site for professional and enthusiast programmers.

1 Answer 1

I think you have the wrong 'KERNEL' setting. From this awesome doc for writing and debugging udev rules:

http://www.reactivated.net/writing_udev_rules.html#basic

I think you need KERNEL=brightness, and perhaps a SUBSYSTEM=leds

Then, in case your distro lacks inotify support. Make sure your changes are being seen by udevd:

# udevcontrol reload_rules
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.