diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-06-03 10:22:25 +0200 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-06-03 10:22:25 +0200 |
commit | 507cb5a824d07f1edf73f270d485180645cb87fa (patch) | |
tree | d632e16ebcc2b0a4be7845396eb971aa605d78a5 /dwmstatus | |
parent | 0bd4fc20e88eb7b94b8bced0571e69c31eede816 (diff) |
also get ips
Diffstat (limited to 'dwmstatus')
-rw-r--r-- | dwmstatus/custom.diff | 12 |
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); |