1 WindowTitle {FvwmApplet-APMMon}
3 #Font -*-lucida-bold-r-normal-*-11-*-*-*-*-*-*
4 Font -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*
5 # Use the FvwmScript default colors.
6 #BackColor {rgb:a0/90/80}
9 #HilightColor {rgb:a0/90/80}
13 Set $APMQuery = {cat /proc/apm}
14 # No time remaining info
15 #Set $APMQuery = {echo 1.16 1.2 0x03 0x01 0x00 0x01 100% -1 \?}
17 #Set $APMQuery = {echo 1.16 1.2 0x03 0x00 0x00 0x01 95% -1 min}
19 #Set $APMQuery = {echo 1.16 1.2 0x03 0x01 0x03 0x09 92% -1 min}
21 Set $MainColorset=(GetScriptArgument 1)
23 If $MainColorset <> {} Then
25 ChangeColorset 0 $MainColorset
26 ChangeColorset 1 $MainColorset
27 ChangeColorset 2 $MainColorset
28 ChangeColorset 3 $MainColorset
30 ChangeForeColor 1 {#ff0028}
31 ChangeForeColor 2 {black}
32 ChangeForeColor 3 {blue}
38 If (RemainderOfDiv (GetTime) 5)==0 Then
40 # 1.16 1.2 0x03 0x01 0x00 0x01 100% 200 min
41 Set $save_ac_bat = $ac_bat
42 Set $save_charging = $charging
44 Set $batcharge = (GetOutput $APMQuery 1 7)
45 Set $remaining = (GetOutput $APMQuery 1 8)
46 Set $ac_batt = (GetOutput $APMQuery 1 4)
47 Set $charging = (GetOutput $APMQuery 1 5)
49 If $remaining == {-1} Then
52 Set $remain_hrs = (Div $remaining 60)
53 Set $raw_remain_min = (RemainderOfDiv $remaining 60)
54 Set $cmd = {printf %02d }$raw_remain_min
55 Set $remain_min = (GetOutput $cmd 1 1)
57 If $ac_batt <> $save_ac_batt Then
59 If $save_charging <> $charging Then
64 Set $title = $batcharge
65 If $remaining <> {} Then
66 Set $title = $title{ }$remain_hrs{:}$remain_min
68 If $save_title <> $title Then
70 Set $save_title= $title
76 If $ac_batt=={0x01} Then
79 If $charging=={0x03} Then
81 # On AC power, battery charging
85 #ChangeForeColor 1 {#ff0028}
89 # On AC power, battery charged
93 #ChangeForeColor 2 {black}
102 #ChangeForeColor 1 {#ff6400}
103 #ChangeForeColor 3 {blue}