On 11/30/06, Ludovic Rousseau <[EMAIL PROTECTED]> wrote:
> On 30/11/06, Hannes Wyss <[EMAIL PROTECTED]> wrote:
> > the following is an alternative to  Ludovic Rousseau's
> > keyboard_brigthness shell-script (1).
> > Advantages:

[... indisputable point about "size doesn't matter" conceded  :)  ...]

> Good idea.
> I just implemented it in my script. Now committed in SVN.
Great, thanks!


> > - can be set SUID and bound to keyboard shortcuts via xbindkeys
>
> Why do you need the SUID bit? On my machine the device is rw for everybody:
> $ ls -l /sys/class/leds/smc\:kbd_backlight/brightness
> -rw-rw-rw- 1 root root 4096 2006-11-30 13:04
> /sys/class/leds/smc:kbd_backlight/brightness

Interesting. Mine isn't (at least not permanently):

doubledog hwyss # ls -l /sys/class/leds/smc\:kbd_backlight/brightness
-rw-r--r-- 1 root root 4096 2006-11-30 16:58
/sys/class/leds/smc:kbd_backlight/brightness
doubledog hwyss # chmod og+w /sys/class/leds/smc\:kbd_backlight/brightness
doubledog hwyss # ls -l /sys/class/leds/smc\:kbd_backlight/brightness
-rw-rw-rw- 1 root root 4096 2006-11-30 16:58
/sys/class/leds/smc:kbd_backlight/brightness
doubledog hwyss # rmmod applesmc; modprobe applesmc
doubledog hwyss # ls -l /sys/class/leds/smc\:kbd_backlight/brightness
-rw-r--r-- 1 root root 4096 2006-11-30 17:10
/sys/class/leds/smc:kbd_backlight/brightness

This is on linux 2.6.18.1 (gentoo) x86_64.

Would you have any hints on where to change that? udev?


> But since you use /var/lib/keylight to store the old value you _have_
> to be root to write in /var/lib.
> My script uses /tmp/keyboard_brigthness_old_value so do not need to be root.

Which gives me the advantage that I can keep my favorite keyboard
illumination-level across /tmp-wiping reboots. Which I admit is not
that incredibly important ;)


> My version is 42 lines of shell script.
> Your version is 113 lines of C (I used sloccount to just count the
> lines of code).
Ah, yes - but I learned a lot writing those 113 lines!

Thanks
Hannes

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mactel-linux-users mailing list
Mactel-linux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mactel-linux-users

Reply via email to