From: <dom...@us...> - 2014-02-15 11:32:35
|
Revision: 603 http://sourceforge.net/p/fvwm-crystal/code/603 Author: dominique_libre Date: 2014-02-15 11:32:33 +0000 (Sat, 15 Feb 2014) Log Message: ----------- scripts/FvwmScript-AcpiBatt: changed the checks from /proc to /sys; patch from Debian Modified Paths: -------------- ChangeLog fvwm/components/scripts/FvwmScript-AcpiBatt Modified: ChangeLog =================================================================== --- ChangeLog 2014-02-15 11:28:05 UTC (rev 602) +++ ChangeLog 2014-02-15 11:32:33 UTC (rev 603) @@ -3,6 +3,8 @@ Samedi 15 février 2015 Dominique Michel recipes/Default with ACPI: fix for height and scripts colorset on the bottom bar; fix for warning with IconMan-Icons. + scripts/FvwmScript-AcpiBatt: changed the checks from /proc to /sys; patch + from Debian. Vendredi 14 février 2014 Dominique Michel scripts/launch: Increased delay to bring Xephyr in fullscreen. Modified: fvwm/components/scripts/FvwmScript-AcpiBatt =================================================================== --- fvwm/components/scripts/FvwmScript-AcpiBatt 2014-02-15 11:28:05 UTC (rev 602) +++ fvwm/components/scripts/FvwmScript-AcpiBatt 2014-02-15 11:32:33 UTC (rev 603) @@ -9,15 +9,15 @@ Init Begin - Set $last = (GetOutput {cat /proc/acpi/battery/BAT?/info} 3 4) - Set $remaining = (GetOutput {cat /proc/acpi/battery/BAT?/state} 5 3) - Set $acstate = (GetOutput {cat /proc/acpi/ac_adapter/AC*/state} 1 2) - Set $batt = (Mult 100 $remaining) - Set $batt = (Div $batt $last) + Set $last = (GetOutput {cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT*/energy_full} 1 -1) + Set $remaining = (GetOutput {cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT*/energy_now} 1 -1) + Set $acstate = (GetOutput {cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT*/status} 1 -1) + Set $batt = (Div $last 100) + Set $batt = (Div $remaining $batt) Set $batt = $batt % Set $batt_prev = -1 - If $acstate==off-line Then + If $acstate==Discharging Then Set $batt = * $batt ChangeTitle 1 $batt End @@ -33,12 +33,12 @@ Else Begin - Set $last = (GetOutput {cat /proc/acpi/battery/BAT?/info} 3 4) - Set $remaining = (GetOutput {cat /proc/acpi/battery/BAT?/state} 5 3) - Set $batt = (Mult 100 $remaining) - Set $batt = (Div $batt $last) + Set $last = (GetOutput {cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT*/energy_full} 1 -1) + Set $remaining = (GetOutput {cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT*/energy_now} 1 -1) + Set $batt = (Div $last 100) + Set $batt = (Div $remaining $batt) Set $batt_prev = $batt - Set $acstate = (GetOutput {cat /proc/acpi/ac_adapter/AC*/state} 1 2) + Set $acstate = (GetOutput {cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT*/status} 1 -1) If $batt>99 Then ChangeColorset 1 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |