elm theme - add procstats mini border gadget

v-1.26.0
Carsten Haitzler 1 year ago
parent 6c084b19b0
commit daa7b6c7e1
  1. 1
      data/elementary/themes/default.edc
  2. 27
      data/elementary/themes/edc/border.edc
  3. 115
      data/elementary/themes/edc/procstats.edc

@ -149,6 +149,7 @@ collections {
#include "edc/bluez5.edc"
#include "edc/packagekit.edc"
#include "edc/tiling.edc"
#include "edc/procstats.edc"
// icons
#include "edc/icons.edc"

@ -570,20 +570,6 @@ group { name: "e/widgets/border/default/border";
visible: 0;
}
}
part { name: "e.swallow.volume";
type: SWALLOW;
source: "e/widgets/border/volume";
description { state: "default" 0.0;
fixed: 1 0;
rel1.to: "e.event.icon";
rel1.relative: 1.0 0.0;
rel2.to: "e.event.icon";
rel2.relative: 1.0 1.0;
rel2.offset: 0 -1;
align: 0.0 0.5;
aspect: 1.0 1.0; aspect_preference: VERTICAL;
}
}
part { name: "procstats"; type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
@ -617,6 +603,19 @@ group { name: "e/widgets/border/default/border";
visible: 1;
}
}
part { name: "e.swallow.volume"; type: SWALLOW;
source: "e/widgets/border/volume";
description { state: "default" 0.0;
fixed: 1 0;
rel1.to: "e.event.icon";
rel1.relative: 1.0 0.0;
rel2.to: "e.event.icon";
rel2.relative: 1.0 1.0;
rel2.offset: 0 -1;
align: 0.0 0.5;
aspect: 1.0 1.0; aspect_preference: VERTICAL;
}
}
}
programs {
program { signal: "e,version,22"; source: "e";

@ -0,0 +1,115 @@
// XXX: fix cc's
group { name: "e/modules/procstats/border";
max: 160 160;
min: 16 16;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1973)) {
new cpu_num, cpu, pages_total, pages;
new cp, cn, m500, mt;
new Float:x, Float:y;
cpu_num = getarg(2);
cpu = getarg(3);
pages_total = getarg(4);
pages = getarg(5);
cp = cpu;
if (cpu_num > 0) cn = cp / cpu_num;
else cn = cp;
m500 = pages * 100 / 131072; // 512m of pages
if (pages_total > 0) mt = pages * 100 / pages_total;
else mt = m500;
if (cp > 100) cp = 100;
if (cn > 100) cn = 100;
if (m500 > 100) m500 = 100;
if (mt > 100) mt = 100;
custom_state(PART:"cpu_perc", "default", 0.0);
get_state_val(PART:"cpu_perc", STATE_REL2, x, y);
x = float(cp) / 100.0;
set_state_val(PART:"cpu_perc", STATE_REL2, x, y);
set_state(PART:"cpu_perc", "custom", 0.0);
custom_state(PART:"cpu_num", "default", 0.0);
get_state_val(PART:"cpu_num", STATE_REL2, x, y);
x = float(cn) / 100.0;
set_state_val(PART:"cpu_num", STATE_REL2, x, y);
set_state(PART:"cpu_num", "custom", 0.0);
custom_state(PART:"mem_500", "default", 0.0);
get_state_val(PART:"mem_500", STATE_REL2, x, y);
x = float(m500) / 100.0;
set_state_val(PART:"mem_500", STATE_REL2, x, y);
set_state(PART:"mem_500", "custom", 0.0);
custom_state(PART:"mem_total", "default", 0.0);
get_state_val(PART:"mem_total", STATE_REL2, x, y);
x = float(mt) / 100.0;
set_state_val(PART:"mem_total", STATE_REL2, x, y);
set_state(PART:"mem_total", "custom", 0.0);
}
}
}
parts {
part { name: "base"; type: RECT;
description { state: "default" 0.0;
aspect: 1.0 1.0; aspect_preference: BOTH;
color_class: "/dim/normal/procstats/border";
}
}
part { name: "area"; type: SPACER;
scale: 1;
description { state: "default" 0.0;
rel.to: "base";
rel1.offset: 2 2;
rel2.offset: -3 -3;
offscale;
}
}
part { name: "cpu_perc"; type: RECT;
description { state: "default" 0.0;
rel.to: "area";
rel1.relative: 0.0 0.00;
rel2.relative: 1.0 0.25;
color: 255 51 153 255;
}
}
part { name: "cpu_num"; type: RECT;
description { state: "default" 0.0;
rel.to: "area";
rel1.relative: 0.0 0.25;
rel2.relative: 1.0 0.50;
color: 255 153 51 255;
}
}
part { name: "mem_500"; type: RECT;
description { state: "default" 0.0;
rel.to: "area";
rel1.relative: 0.0 0.50;
rel2.relative: 1.0 0.75;
color: 153 255 51 255;
}
}
part { name: "mem_total"; type: RECT;
description { state: "default" 0.0;
rel.to: "area";
rel1.relative: 0.0 0.75;
rel2.relative: 1.0 1.00;
color: 51 153 255 255;
}
}
part { name: "over"; type: RECT;
description { state: "default" 0.0;
color: 0 0 0 0; // no cc
}
}
}
programs {
}
}
Loading…
Cancel
Save