[Debian-eeepc-devel] Changes for eeepc-acpi-scripts

jcsid jc.sid at free.fr
Thu Jun 12 22:56:40 UTC 2008


>
> --- Desktop/eeepc-acpi-scripts/eeepc-acpi-scripts/actions/hotkey.sh	2008-04-25 14:29:09.000000000 +0200
> > +++ /etc/acpi/actions/hotkey.sh	2008-06-12 10:26:23.000000000 +0200
>
>> > -	if [ -n "$2" -a -z "$(echo $2 | sed 's/[0-9]//g')" ]; then
>> > -		echo "$@%" | aosd_cat -f 0 -u 100 -o 0 -n "$OSD_FONT" &
>> > -	else
>> > -		echo "$@" | aosd_cat -n "$OSD_FONT" -f 100 -u 1000 -o 100 &
>> > -	fi
>> > +		echo "$@" | aosd_cat -n "$OSD_FONT" -f 80 -u 1000 -o 80 -e 0 -b 155 -B $OSD_BG_COLOR -R $OSD_COLOR -x $OSD_X -y $OSD_Y  &
>>     
>
> This change is also broken, the purpose of the if here is to 
> have osd messages without some numeric value (like Audio 
> off) displayed longer than the Volume level as these outputs 
> do not have the problem of changing quite fast.
>
>   
Well, the important change I wanted to do was colors, and positions: the 
base green with shadow was not so beautifull. I removed the "percent" 
condition because it was showing the batt. charge like contrast and 
volume. When I did, I saw that was not so bad.
>> >  > -    notify Volume $percent
>> > +    notify Volume $percent%
>>     
>
> The % is handled by notify but you removed this in the above 
> change.
>   
That's it
>   
>> > +show_brightness() {
>> > +    # final digit of ACPI code is brightness level in hex
>> > +    level=$(cat /proc/acpi/asus/brn)
>> > +    # convert hex digit to percent
>> > +    percent=$(((100 * $level + 8) / 15))
>> > +    notify Brightness $percent%
> We decided to not use something like this in the past 
> because having if you look at the brightness on your screen 
> this is way more meaningful than some percentage value.
> That's why it was commented out.
>
>   
I uncomented, and changed " level=$(cat /proc/acpi/asus/brn)" witch 
wasn't set. It can be commented in the package, but working if not...

>> > +show_batt() {
>> > +	status=$(cat /proc/acpi/battery/BAT0/state | grep 'charging')
>> > +	percent=$(cat /proc/acpi/battery/BAT0/state | grep 'remaining capacity')
>> > +	percent=${percent%*mAh}
>> > +	notify Batt.${status#*:}: ${percent#*:}%
> This is broken, the battery paths are not hardcoded in acpi 
> and besides that /proc/acpi is not available in 2.6.25 
> anymore.
>   
The interest is the "LOW BATTERY" message shown when 00000052 signal is 
recieved.
Well, if this doesn't work in 2.6.25, then it's broken. I just noticed 
that 00000050 signal is receved when plugging ac and 00000051 when 
unplugging.
>> > -	amixer -q set $VOLUME_LABEL 2- unmute
>> > +	amixer -q set $VOLUME_LABEL 4- unmute
>>     
>
> At least for me steps by 2- are ok, what do others think?
>   
With 2- I had to press 16 times to get a half volume. With 4-, 8 times. 
That's true it's less precise but it's faster
>> > +    # Fn+F6 -- launch $AP_APP
>> > +    00000012)
>> > +	notify $AP_MSG
>> > +	$AP_APP
>> > +	;;
>>     
>
> Also useless OSD output, But having fn-f6 work might be 
> nice.
>   
Not so bad, so
>> > --- Desktop/eeepc-acpi-scripts/eeepc-acpi-scripts/actions/suspend.sh	2008-04-25 14:29:09.000000000 +0200
>> > +++ /etc/acpi/actions/suspend.sh	2008-06-10 16:58:52.000000000 +0200
>> > @@ -10,5 +10,13 @@
>> >  brn_control=/proc/acpi/asus/brn
>> >  
>> >  brightness=$(cat $brn_control)
>> > +wireless=$(cat /proc/acpi/asus/wlan)
>> > +/etc/acpi/actions/wireless.sh off
>>     
>
> I am opposed to that, if you need to switch off wireless 
> because of suspend that's a bug in the driver and should be 
> fixed there.
>
>   
>> > --- Desktop/eeepc-acpi-scripts/eeepc-acpi-scripts/actions/wireless.sh	2008-04-25 14:29:09.000000000 +0200
>> > +++ /etc/acpi/actions/wireless.sh	2008-06-12 10:33:13.000000000 +0200
>> > @@ -1,25 +1,23 @@
>> >  #!/bin/sh
>> >  
>> >  wlan_control=/proc/acpi/asus/wlan
>> > -
>> >  case $1 in
>> > -    on|enable)
>> > -	if [ $(cat $wlan_control) = 0 ]; then
>> > -	    modprobe -r pciehp
>> > -	    modprobe pciehp pciehp_force=1
>> > -	    echo 1 > $wlan_control
>> > -	    modprobe ath_pci
>> > -	    if ! ifconfig ath0 up; then exec $0 off; fi
>> > -	fi
>> > -	;;
>> > -    off|disable)
>> > -	if [ $(cat $wlan_control) = 1 ]; then
>> > -	    ifdown --force ath0
>> > -	    modprobe -r ath_pci
>> > -	    echo 0 > $wlan_control
>> > -	fi
>> > +    on)
>> > +	echo 1 > $wlan_control
>> > +	modprobe ath_pci
>> > +	ifup ath0 &
>>     
>
> Why did you remove the part that checks if the wireless is 
> already on and does nothing if this is true?
>   
00000010 is always received when wifi is off and 00000011 when off. So 
no need to check, and so the script goes faster
> You also removed loading pciehp without an obvious reason.
>   
We had a discussion about this in the same mailing-list and found 
obvious reason:
The problem with pciehp was not that it was removed EACH time wireless 
was toggled, but just when eeepc is suspended...
So I put "pciehp pciehp_force=1" in /etc/modules and where it was a 
problem: suspend.sh. There is no need to reload it each time wireless is 
switched on. Doing this makes wireless.sh running lower and doing things 
he doesn't have to. The choice to reload wireless after a suspend is to 
let pciehp loading. If not, fn-f2 wouldnt work after a suspend. I agree 
it's a bug and it's not resolved this way. But it wasn't before.
> A bit of reasoning for your changes would be nice.

These are suggestions that I found useless. I know it can't be for 
everybody. Maybe have you got The ones with the right reasoning.




More information about the Debian-eeepc-devel mailing list