| 1 |
# |
| 2 |
# LiNiO <[email protected]> - 2005.01.15 |
| 3 |
# 2005.08.12 - jeśli wartość się nie zmieniła, nie wyświetla jej ponownie - usunięcie efektu "migotania" |
| 4 |
# |
| 5 |
# o 2015.10.02 - Use same colorset than the AcpiBatt applet |
| 6 |
# Dominique Michel <[email protected]> |
| 7 |
|
| 8 |
UseGettext {$FVWM_USERDIR/locale;fvwm-crystal-script:$FVWM_SYSTEMDIR/locale;fvwm-crystal-script:+} |
| 9 |
WindowTitle {FvwmScript-CpuTemp} |
| 10 |
WindowSize 48 24 |
| 11 |
Font "xft:Tahoma:pixelsize=12:Bold" |
| 12 |
Colorset 12 |
| 13 |
|
| 14 |
Init |
| 15 |
Begin |
| 16 |
Set $temp_prev = 1 |
| 17 |
Set $temp = (GetOutput {sed 's:...$::' </sys/class/hwmon/hwmon0/temp1_input} 1 1) |
| 18 |
Set $degree = (Gettext {°C}) |
| 19 |
Set $tmp = $temp $degree |
| 20 |
ChangeTitle 1 $tmp |
| 21 |
End |
| 22 |
|
| 23 |
PeriodicTasks |
| 24 |
Begin |
| 25 |
If (RemainderOfDiv (GetTime) 2)==0 Then |
| 26 |
Begin |
| 27 |
Set $temp = (GetOutput {sed 's:...$::' </sys/class/hwmon/hwmon0/temp1_input} 1 1) |
| 28 |
Set $degree = (Gettext {°C}) |
| 29 |
Set $tmp = $temp $degree |
| 30 |
|
| 31 |
If $temp==$temp_prev Then |
| 32 |
Begin |
| 33 |
# do nothing |
| 34 |
End |
| 35 |
Else |
| 36 |
Begin |
| 37 |
|
| 38 |
If $temp>89 Then |
| 39 |
ChangeColorset 1 17 |
| 40 |
Else |
| 41 |
Begin |
| 42 |
If $temp>79 Then |
| 43 |
ChangeColorset 1 16 |
| 44 |
Else |
| 45 |
Begin |
| 46 |
If $temp>69 Then |
| 47 |
ChangeColorset 1 15 |
| 48 |
Else |
| 49 |
Begin |
| 50 |
If $temp>59 Then |
| 51 |
ChangeColorset 1 14 |
| 52 |
Else |
| 53 |
Begin |
| 54 |
If $temp>49 Then |
| 55 |
ChangeColorset 1 13 |
| 56 |
Else |
| 57 |
ChangeColorset 1 12 |
| 58 |
End |
| 59 |
End |
| 60 |
End |
| 61 |
End |
| 62 |
|
| 63 |
ChangeTitle 1 $tmp |
| 64 |
End |
| 65 |
Set $temp_prev = $temp |
| 66 |
End |
| 67 |
End |
| 68 |
|
| 69 |
Widget 1 |
| 70 |
Property |
| 71 |
Position 0 -2 |
| 72 |
Size 48 24 |
| 73 |
Type ItemDraw |
| 74 |
Flags NoReliefString |
| 75 |
Title {} |
| 76 |
Colorset 12 |
| 77 |
Main |
| 78 |
Case message of |
| 79 |
SingleClic : |
| 80 |
Begin |
| 81 |
End |
| 82 |
End |
| 83 |
|