forked from enlightenment/efl
130 lines
4.3 KiB
Plaintext
130 lines
4.3 KiB
Plaintext
group { name: "e/modules/cpumonitor/main";
|
|
image: "cpu_icon.png" COMP;
|
|
image: "mem_icon.png" COMP;
|
|
image: "meter_00.png" COMP;
|
|
image: "meter_01.png" COMP;
|
|
image: "meter_02.png" COMP;
|
|
image: "meter_03.png" COMP;
|
|
image: "meter_04.png" COMP;
|
|
image: "meter_05.png" COMP;
|
|
image: "meter_06.png" COMP;
|
|
image: "meter_07.png" COMP;
|
|
image: "meter_08.png" COMP;
|
|
image: "meter_09.png" COMP;
|
|
image: "meter_10.png" COMP;
|
|
script {
|
|
public message(Msg_Type:type, id, ...) {
|
|
if ((type == MSG_INT_SET) && (id == 1)) {
|
|
new status = getarg(2);
|
|
new text[16];
|
|
if (status == 0)
|
|
set_state(PART:"meter", "default", 0.0);
|
|
else if (status > 0 && status < 10)
|
|
set_state(PART:"meter", "default", 0.1);
|
|
else if (status >= 10 && status < 20)
|
|
set_state(PART:"meter", "default", 0.2);
|
|
else if (status >= 20 && status < 30)
|
|
set_state(PART:"meter", "default", 0.3);
|
|
else if (status >= 30 && status < 40)
|
|
set_state(PART:"meter", "default", 0.4);
|
|
else if (status >= 40 && status < 50)
|
|
set_state(PART:"meter", "default", 0.5);
|
|
else if (status >= 50 && status < 60)
|
|
set_state(PART:"meter", "default", 0.6);
|
|
else if (status >= 60 && status < 70)
|
|
set_state(PART:"meter", "default", 0.7);
|
|
else if (status >= 70 && status < 80)
|
|
set_state(PART:"meter", "default", 0.8);
|
|
else if (status >= 80 && status < 90)
|
|
set_state(PART:"meter", "default", 0.9);
|
|
else if (status >= 90 && status <= 100)
|
|
set_state(PART:"meter", "default", 1.0);
|
|
snprintf(text, sizeof(text), "CPU: %i %%", status);
|
|
set_text(PART:"status", text);
|
|
}
|
|
}
|
|
}
|
|
parts {
|
|
part { name: "fade_clip"; type: RECT;
|
|
description { state: "default" 0.0;
|
|
color: 255 255 255 255;
|
|
}
|
|
}
|
|
part { name: "base";
|
|
clip_to: "fade_clip";
|
|
description { state: "default" 0.0;
|
|
aspect: 1.0 1.0;
|
|
aspect_preference: BOTH;
|
|
image.normal: "cpu_icon.png";
|
|
}
|
|
}
|
|
part { name: "meter";
|
|
clip_to: "fade_clip";
|
|
description { state: "default" 0.0;
|
|
rel1.relative: 0.1 0.4;
|
|
rel2.relative: 0.9 0.6;
|
|
image.normal: "meter_00.png";
|
|
color: 255 255 255 190;
|
|
}
|
|
description { state: "default" 0.1;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_01.png";
|
|
}
|
|
description { state: "default" 0.2;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_02.png";
|
|
}
|
|
description { state: "default" 0.3;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_03.png";
|
|
}
|
|
description { state: "default" 0.4;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_04.png";
|
|
}
|
|
description { state: "default" 0.5;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_05.png";
|
|
}
|
|
description { state: "default" 0.6;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_06.png";
|
|
}
|
|
description { state: "default" 0.7;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_07.png";
|
|
}
|
|
description { state: "default" 0.8;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_08.png";
|
|
}
|
|
description { state: "default" 0.9;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_09.png";
|
|
}
|
|
description { state: "default" 1.0;
|
|
inherit: "default" 0.0;
|
|
image.normal: "meter_10.png";
|
|
}
|
|
}
|
|
part { name: "status"; type: TEXT; mouse_events: 0;
|
|
scale: 1;
|
|
effect: SHADOW BOTTOM;
|
|
clip_to: "fade_clip";
|
|
description { state: "default" 0.0;
|
|
color_class: "module_label";
|
|
color3: 255 255 255 255;
|
|
rel1.relative: 0.1 0.0;
|
|
rel2.relative: 0.9 1.0;
|
|
text { font: FNBOLD;
|
|
fit: 1 1;
|
|
elipsis: -1;
|
|
align: 0.5 0.5;
|
|
text_class: "module_small";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|