summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dwmstatus/custom.diff12
1 files changed, 10 insertions, 2 deletions
diff --git a/dwmstatus/custom.diff b/dwmstatus/custom.diff
index 14db8a7..d5080f3 100644
--- a/dwmstatus/custom.diff
+++ b/dwmstatus/custom.diff
@@ -67,6 +67,12 @@ index d2a4b03..4f09dde 100644
+ return getresult(co);
+}
+
++char *
++getips() {
++ char *co = smprintf("ip a | grep 'inet ' | grep -v 127.0.0.1 | tr -s ' ' | cut -f 3 -d ' ' | tr '\n' ' '");
++ return getresult(co);
++}
++
int
main(void)
{
@@ -81,6 +87,7 @@ index d2a4b03..4f09dde 100644
+ char *partition;
+ char *temp;
+ char *track;
++ char *ips;
if (!(dpy = XOpenDisplay(NULL))) {
fprintf(stderr, "dwmstatus: cannot open display.\n");
@@ -88,7 +95,7 @@ index d2a4b03..4f09dde 100644
}
- for (;;sleep(60)) {
-+ for (;;sleep(10)) {
++ for (;;sleep(1)) {
avgs = loadavg();
- bat = getbattery("/sys/class/power_supply/BAT0");
- bat1 = getbattery("/sys/class/power_supply/BAT1");
@@ -106,8 +113,9 @@ index d2a4b03..4f09dde 100644
+ tmbln = mktimes("%a %d %b %H:%M", tzberlin);
+ temp = gettemp();
+ track = gettrack();
++ ips = getips();
+
-+ status = smprintf(" %s | %s | %s | %s | %s",
++ status = smprintf(" %s | %s | %s | %s | %s | %s",
+ track, avgs, temp, partition, tmbln);
setstatus(status);