projects
/
sysstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6949724
)
Change named colors to hex values
author
norly
<ny-git@enpas.org>
Wed, 2 Oct 2013 13:42:39 +0000
(15:42 +0200)
committer
norly
<ny-git@enpas.org>
Wed, 2 Oct 2013 13:42:39 +0000
(15:42 +0200)
src/status/battery.c
patch
|
blob
|
history
src/status/cpuusage.c
patch
|
blob
|
history
src/status/datetime.c
patch
|
blob
|
history
src/status/fan.c
patch
|
blob
|
history
src/status/memusage.c
patch
|
blob
|
history
src/status/netif.c
patch
|
blob
|
history
src/status/temp.c
patch
|
blob
|
history
src/status/uptime.c
patch
|
blob
|
history
src/status/volume_alsa.c
patch
|
blob
|
history
diff --git
a/src/status/battery.c
b/src/status/battery.c
index 65fdd1bc93bb9eb53a16bfc972a3945ed2ea0a26..329e5310805051fcdc7c53b7342628379678e75c 100644
(file)
--- a/
src/status/battery.c
+++ b/
src/status/battery.c
@@
-79,21
+79,21
@@
void status_battery(GlobalData *g, char *batname)
if (chargePercent <= 40) {
if (chargePercent <= 25) {
if (chargePercent <= 10) {
if (chargePercent <= 40) {
if (chargePercent <= 25) {
if (chargePercent <= 10) {
- s.color = "
red";
+ s.color = "
#FF0000"; // red
} else {
// 11-25%
} else {
// 11-25%
- s.color = "
orange";
+ s.color = "
#FFA500"; // orange
}
} else {
// 26-40%
}
} else {
// 26-40%
- s.color = "
yellow";
+ s.color = "
#FFFF00"; // yellow
}
} else {
if (chargePercent > 70) {
}
} else {
if (chargePercent > 70) {
- s.color = "
white";
+ s.color = "
#FFFFFF"; // white
} else {
// 41-70%
} else {
// 41-70%
- s.color = "
green";
+ s.color = "
#22FF22"; // green
}
}
}
}
diff --git
a/src/status/cpuusage.c
b/src/status/cpuusage.c
index a3b1d5dd9012dfc6d2dc96443d22bfac7d9a6c62..bf82fe6947f5d94cd2c47df2399ec9d07fc5ba05 100644
(file)
--- a/
src/status/cpuusage.c
+++ b/
src/status/cpuusage.c
@@
-45,7
+45,7
@@
void status_cpuusage(GlobalData *g)
s.text = text;
// Error signaling color
s.text = text;
// Error signaling color
- s.color = "
yellow";
+ s.color = "
#FFFF00"; // yellow
stfile = fopen("/proc/stat", "r");
if (stfile != NULL) {
stfile = fopen("/proc/stat", "r");
if (stfile != NULL) {
diff --git
a/src/status/datetime.c
b/src/status/datetime.c
index d7d9d0a4e78407c3daf2f8310dd03c51e29e75bb..304b858fb8b9e41e65d81152256525454bdd86f9 100644
(file)
--- a/
src/status/datetime.c
+++ b/
src/status/datetime.c
@@
-19,7
+19,7
@@
void status_datetime(GlobalData *g)
nows = time(NULL);
if (nows == ((time_t) -1)) {
nows = time(NULL);
if (nows == ((time_t) -1)) {
- s.color = "
red";
+ s.color = "
#FF0000"; // red
s.text = "ERROR: DATETIME";
line_append_item(g, &s);
s.text = "ERROR: DATETIME";
line_append_item(g, &s);
@@
-35,7
+35,7
@@
void status_datetime(GlobalData *g)
);
line_append_item(g, &s);
);
line_append_item(g, &s);
- s.color = "
grey";
+ s.color = "
#BEBEBE"; // grey
snprintf(text, sizeof(text),
"%d:%.2d"
#ifdef SHOW_SECONDS
snprintf(text, sizeof(text),
"%d:%.2d"
#ifdef SHOW_SECONDS
diff --git
a/src/status/fan.c
b/src/status/fan.c
index 6b266784934ced88169db3ae2769d2480dc95c17..097781476c691d096d38a7b4bb248818b6e990d1 100644
(file)
--- a/
src/status/fan.c
+++ b/
src/status/fan.c
@@
-25,7
+25,7
@@
void status_fan(GlobalData *g, char *title, char *sysfile)
// Read a valid value? Sometimes we get garbage from sysfs...
if (stlen > 5) {
// Read a valid value? Sometimes we get garbage from sysfs...
if (stlen > 5) {
- s.color = "
red";
+ s.color = "
#FF0000"; // red
snprintf(text, sizeof(text), "%sERROR", title);
} else {
stline[stlen - 1] = '\0';
snprintf(text, sizeof(text), "%sERROR", title);
} else {
stline[stlen - 1] = '\0';
diff --git
a/src/status/memusage.c
b/src/status/memusage.c
index f69c0274b747e7749c0efdd043e8c048ccfeb5fd..6e715145aa6940a91e98db092505ce379fb96898 100644
(file)
--- a/
src/status/memusage.c
+++ b/
src/status/memusage.c
@@
-47,9
+47,9
@@
void status_memusage(GlobalData *g)
/* Change color based on % of RAM used */
if ((float)memused / (float)memtotal < 0.85) {
/* Change color based on % of RAM used */
if ((float)memused / (float)memtotal < 0.85) {
- s.color = "
green";
+ s.color = "
#22FF22"; // green
} else {
} else {
- s.color = "
red";
+ s.color = "
#FF0000"; // red
}
snprintf(text, sizeof(text), "Mem: %d M", memused);
}
snprintf(text, sizeof(text), "Mem: %d M", memused);
diff --git
a/src/status/netif.c
b/src/status/netif.c
index 3c0fef0ba1e2c8b6d435a17d5396750bf7a878c9..e760b4c7393420944996b1dfd28d8cd2156c2d7a 100644
(file)
--- a/
src/status/netif.c
+++ b/
src/status/netif.c
@@
-44,7
+44,7
@@
void status_netif(GlobalData *g, char *ifname)
/* Is the interface up? */
if (access(ifpath, F_OK)) {
/* Is the interface up? */
if (access(ifpath, F_OK)) {
- //s.color = "
grey";
+ //s.color = "
#BEBEBE"; // grey
return;
}
return;
}
@@
-53,9
+53,9
@@
void status_netif(GlobalData *g, char *ifname)
stlen = fileRead(stline, sizeof(stline), ifpath);
if (stlen > 0) {
if (stline[0] == '1') {
stlen = fileRead(stline, sizeof(stline), ifpath);
if (stlen > 0) {
if (stline[0] == '1') {
- s.color = "
yellow";
+ s.color = "
#FFFF00"; // yellow
} else {
} else {
- //s.color = "
red";
+ //s.color = "
#FF0000"; // red
return;
}
} else {
return;
}
} else {
diff --git
a/src/status/temp.c
b/src/status/temp.c
index c102fcd776585c25de77759af53aa8e62fbf3ccf..bcd189a54ad09dc0e2470cca4c5d8727b660bce3 100644
(file)
--- a/
src/status/temp.c
+++ b/
src/status/temp.c
@@
-28,7
+28,7
@@
void status_temp(GlobalData *g, char *title, char *sysfile)
* Sometimes we get garbage from sysfs...
*/
if (stlen < 6 || stlen > 7) {
* Sometimes we get garbage from sysfs...
*/
if (stlen < 6 || stlen > 7) {
- s.color = "
red";
+ s.color = "
#FF0000"; // red
snprintf(text, sizeof(text), "%sERROR", title);
} else {
stline[stlen - 4] = '\0';
snprintf(text, sizeof(text), "%sERROR", title);
} else {
stline[stlen - 4] = '\0';
diff --git
a/src/status/uptime.c
b/src/status/uptime.c
index ef5b2e5d90f1879005ae0d847ccb4926b1c0ba1d..d82d068c87a05c334c7b3a83a62d27479ed61333 100644
(file)
--- a/
src/status/uptime.c
+++ b/
src/status/uptime.c
@@
-23,7
+23,7
@@
void status_uptime(GlobalData *g)
stlen = fileRead(stline, sizeof(stline), "/proc/uptime");
if (stlen < 0) {
stlen = fileRead(stline, sizeof(stline), "/proc/uptime");
if (stlen < 0) {
- s.color = "
red";
+ s.color = "
#FF0000"; // red
s.text = "up: ERROR";
} else {
unsigned textlen = 0;
s.text = "up: ERROR";
} else {
unsigned textlen = 0;
diff --git
a/src/status/volume_alsa.c
b/src/status/volume_alsa.c
index 54fe44ef8c07c20627ea173f92c0ac5df559efb0..bdef6668a6a997721e180db232bc55a666f265ed 100644
(file)
--- a/
src/status/volume_alsa.c
+++ b/
src/status/volume_alsa.c
@@
-54,7
+54,7
@@
int status_volume_alsa(GlobalData *g,
snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
snd_mixer_selem_get_playback_volume(elem, channel, &volume);
snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
snd_mixer_selem_get_playback_volume(elem, channel, &volume);
- s.color = on_off ? "#22FF22" : "
red";
+ s.color = on_off ? "#22FF22" : "
#FF0000"; // green/red
snprintf(text, sizeof(text), "Vol: %d", (int)volume);
}
snprintf(text, sizeof(text), "Vol: %d", (int)volume);
}