![]() ![]() |
Oct 16 2007, 02:01 AM
Post
#1
|
|
![]() Group: Members Posts: 376 Joined: 18-March 04 From: The Netherlands Member No.: 2,380 |
It's kind of irritating that a lot of distributions lack working brightness adjustment these days, while that's the most simple way of conserving the battery.
Since debian also lacks this control using Fn-3 and Fn-4, I thought I'd give it a try myself. Here's my solution: First, copy the Angstrom script to /usr/bin and make it executable. The script I use is: CODE #!/bin/sh # display-brightness.sh # simple script to set display-brightness for zaurus clamshell # author: patrick steiner <[EMAIL PROTECTED]> # modified by: Ian Munsie <[EMAIL PROTECTED]> # version: 1.01 | 13.07.2007 15:00 STEP=5 MIN=1 DRIVER="`ls /sys/class/backlight/|head -n 1`" BRIGHTNESS_FILE="/sys/class/backlight/$DRIVER/brightness" MAX_BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/max_brightness` POWER_FILE="/sys/class/backlight/$DRIVER/power" POWER_ON=0 if [ ! -n "$1" ]; then echo "max / current" echo "$MAX_BRIGHTNESS / $ACTUAL_BRIGHTNESS" elif [ "$1" = "up" ]; then #test -x /usr/bin/bl && bl on echo $POWER_ON >> $POWER_FILE ACTUAL_BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/actual_brightness` let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS+$STEP test "$CURRENT_BRIGHTNESS" -gt "$MAX_BRIGHTNESS" && CURRENT_BRIGHTNESS=$MAX_BRIGHTNESS echo $CURRENT_BRIGHTNESS >> $BRIGHTNESS_FILE elif [ "$1" = "down" ]; then ACTUAL_BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/actual_brightness` let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS-$STEP test "$CURRENT_BRIGHTNESS" -lt "$MIN" && CURRENT_BRIGHTNESS=$MIN echo $CURRENT_BRIGHTNESS >> $BRIGHTNESS_FILE else echo -e "\nUsage:\n\t `basename $0` [up | down]\n" fi Next, apt-get xbindkeys and xbindkeys-config Use xbindkeys-config to assign the display-brightness script to the Fn-3 and Fn-4 using the parameters down and up respectively. Then run xbindkeys Et voila! |
|
|
|
Oct 16 2007, 02:07 AM
Post
#2
|
|
|
Group: Members Posts: 2,003 Joined: 16-April 04 From: the Netherlands && /dev/null Member No.: 2,882 |
Wow. That's nice!
It's good to see your "decaffeinated" Z running Debian? I simply use the setfl script from pdaXrom and change the brightness adjustment interval from 1 to 5, then use the icewm to bind the keys. http://www.oesf.org/forum/index.php?act=fi...&pid=168157 |
|
|
|
Oct 16 2007, 04:52 AM
Post
#3
|
|
|
Group: Members Posts: 2,003 Joined: 16-April 04 From: the Netherlands && /dev/null Member No.: 2,882 |
@cortez: so would you be interested in making sound play (through the speaker) as well?
|
|
|
|
Oct 16 2007, 11:55 AM
Post
#4
|
|
![]() Group: Members Posts: 376 Joined: 18-March 04 From: The Netherlands Member No.: 2,380 |
It's good to see your "decaffeinated" Z running Debian? I simply use the setfl script from pdaXrom and change the brightness adjustment interval from 1 to 5, then use the icewm to bind the keys. http://www.oesf.org/forum/index.php?act=fi...&pid=168157 Maybe I should use the search option a bit more often... Oh, and by the way, my C750 is still dead, it's my replacement C3100 that's running Debian @cortez: so would you be interested in making sound play (through the speaker) as well? I'm still in the exploration-phase, so I haven't been able to test the sound I'm afraid. It's really amazing that so far everything I install seems to work. No stability problems whatsoever. Ever tried the Mozilla variant Kazehakase? Anyway, give me a bit more time, and maybe I can help. First I have to setup a build system. What do you guys use, scratchbox? |
|
|
|
Oct 16 2007, 01:15 PM
Post
#5
|
|
![]() Group: Members Posts: 1,019 Joined: 15-February 05 From: France Member No.: 6,477 |
little problem again with the setfl script : my default user cannot change the brightness because it cannot access /sys/class/backlight/corgi-bl/brightness .....
should i use sudo setfl or is there a better way ? |
|
|
|
Oct 16 2007, 01:33 PM
Post
#6
|
|
|
Group: Members Posts: 2,003 Joined: 16-April 04 From: the Netherlands && /dev/null Member No.: 2,882 |
Actually I find xbindkeys works better than the keys setting in IceWM. xbindkeys is totally WM-independent and it can correctly pick up the Fn key, which the .icewm/keys setting fails to bind. Now I can use [Fn]+3 & 4 to turn backlight up and down easily.
Scratchbox seems an ideal choice. But I have yet to spare some solid time to learn the basics and get some initial practice. So for now I am still using the native toolchain to build several apps that are missing in the official feeds. The GCC 4.2.1 toolchain really rocks! With a big (512MB) swap in both my internal CF and "external" microdrive many programs got compiled with ease. Truly, most Debian ARM packages just work and they run faster than I assumed (after worrying so much about optimization and perfecting builds in the air As for compiling strategy, I would use whatever available in the official feeds, while compiling new stuff (missing and "experimental") and recompiling things to better the performance along the way. |
|
|
|
Oct 16 2007, 01:35 PM
Post
#7
|
|
|
Group: Members Posts: 2,003 Joined: 16-April 04 From: the Netherlands && /dev/null Member No.: 2,882 |
little problem again with the setfl script : my default user cannot change the brightness because it cannot access /sys/class/backlight/corgi-bl/brightness ..... should i use sudo setfl or is there a better way ? How about: creating a wheel group. adding your user to the wheel group, then visudo to set up the rights for the wheel group, then chgrp wheel setfl ? |
|
|
|
Oct 17 2007, 03:27 AM
Post
#8
|
|
![]() Group: Members Posts: 1,019 Joined: 15-February 05 From: France Member No.: 6,477 |
little problem again with the setfl script : my default user cannot change the brightness because it cannot access /sys/class/backlight/corgi-bl/brightness ..... should i use sudo setfl or is there a better way ? How about: creating a wheel group. adding your user to the wheel group, then visudo to set up the rights for the wheel group, then chgrp wheel setfl ? well, surprisingly, i could not create a wheel group : addgroup failed with error code so i decided to put a my_user NOPASSWD: ALL in sudoers for my normal user... now sudo setfl - is working thanks |
|
|
|
Oct 21 2007, 11:52 PM
Post
#9
|
|
|
Group: Members Posts: 1,141 Joined: 22-April 04 From: Belgium Member No.: 2,962 |
Related to this I'm playing with "gpe-conf" (the gpe-settings-apps)
So far I've got "date & time" , "network" (partial) , "users manager" , "usb" , "screen setup" (backlight!!), "cardinfo", "sytem info" working. Chero. |
|
|
|
Oct 22 2007, 07:34 AM
Post
#10
|
|
![]() Group: Members Posts: 1,019 Joined: 15-February 05 From: France Member No.: 6,477 |
Related to this I'm playing with "gpe-conf" (the gpe-settings-apps) So far I've got "date & time" , "network" (partial) , "users manager" , "usb" , "screen setup" (backlight!!), "cardinfo", "sytem info" working. Chero. would you tell us more ? what did you install actually ? are these applets or menu items ? under which window manager ? |
|
|
|
Oct 22 2007, 11:46 AM
Post
#11
|
|
|
Group: Members Posts: 1,141 Joined: 22-April 04 From: Belgium Member No.: 2,962 |
Related to this I'm playing with "gpe-conf" (the gpe-settings-apps) So far I've got "date & time" , "network" (partial) , "users manager" , "usb" , "screen setup" (backlight!!), "cardinfo", "sytem info" working. Chero. would you tell us more ? what did you install actually ? are these applets or menu items ? under which window manager ? I compiled gpe-conf and they are menu-items. The window manager doesn't matter. |
|
|
|
Oct 25 2007, 04:03 PM
Post
#12
|
|
|
Group: Members Posts: 283 Joined: 1-October 07 From: Blacksburg, SC, USA Member No.: 20,773 |
Amy chance of a deb of it? or tar ball?
|
|
|
|
Oct 25 2007, 10:00 PM
Post
#13
|
|
|
Group: Members Posts: 1,141 Joined: 22-April 04 From: Belgium Member No.: 2,962 |
That's the plan, but the project is sleeping right now.
I have to include some config files in /etc to make everything work. Chero |
|
|
|
Nov 25 2007, 06:31 PM
Post
#14
|
|
|
Group: Members Posts: 11 Joined: 25-November 07 Member No.: 20,984 |
I think everything *except* gpe-conf and bl can be found in the feeds at the moment. Snarfing gpe-conf from Angstrom and getting the GPE support libraries from the feeds worked for me (as well as snarfing Angstrom's bl script in /usr/bin, which really does nothing more than invokes gpe-conf).
|
|
|
|
Nov 25 2007, 08:05 PM
Post
#15
|
|
|
Group: Members Posts: 283 Joined: 1-October 07 From: Blacksburg, SC, USA Member No.: 20,773 |
Found this worked for me pretty well.
CODE ########################### # xbindkeys configuration # ########################### # # Version: 0.1.3 # # If you edit this, do not forget to uncomment any lines that you change. # The pound(#) symbol may be used anywhere for comments. # # A list of keys is in /usr/include/X11/keysym.h and in # /usr/include/X11/keysymdef.h # The XK_ is not needed. # # List of modifier (on my keyboard): # Control, Shift, Mod1 (Alt), Mod2 (NumLock), # Mod3 (CapsLock), Mod4, Mod5 (Scroll). # # Another way to specifie a key is to use 'xev' and set the # keycode with c:nnn or the modifier with m:nnn where nnn is # the keycode or the state returned by xev # # This file is created by xbindkey_config # The structure is : # # Remark # "command" # m:xxx + c:xxx # Shift+... #keystate_numlock = enable #keystate_scrolllock = enable #keystate_capslock = enable #BrDown "/usr/bin/display-brightness.sh down" m:0x10 + c:12 Mod2 + 3 #BrUp "/usr/bin/display-brightness.sh up" m:0x10 + c:13 Mod2 + 4 #Left Click #"xmodmap -e "pointer = 1 2 3"" # alt #Middle Click #"xmodmap -e "pointer = 2 3 1"" # m:0x0 + c:68 #Right click #"xmodmap -e "pointer = 3 1 2"" # m:0x40 + c:105 # control #Backlight On "bl on" m:0x10 + c:14 Mod2 + 5 #Backlight Off "bl off" m:0x10 + c:15 Mod2 + 6 #Home Row #Calendar #"xfce-terminal" #Address #Home #Menu # End of xbindkeys configuration file is .xbindkeyrc |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 12:06 PM |