sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 9f7b413e3f54a2d1e021459d91cbd68c88cfdff3
parent 1dcac268d15b6b221bfb92abf508bf9191f28e37
Author: levi0x0 <levi0x0x@gmail.com>
Date:   Tue, 24 Feb 2015 23:31:14 +0200

Fix for barM.c the NULL pointer

Diffstat:
Mdwm.suckless.org/dwmstatus/barM.c | 16+++-------------
1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/dwm.suckless.org/dwmstatus/barM.c b/dwm.suckless.org/dwmstatus/barM.c @@ -72,19 +72,9 @@ void XSetRoot(char *name) { int main(int argc, char **argv) { char status[MAXSTR]; - /*append here your commands for the spawn function*/ - char *ram = spawn("free -mh | awk 'NR==2{print $3\"/\"$2}'"); - - /* Examples: - char *battery = spawn("/sys/class/power_supply/BAT1/capacity"); - char *uname = spawn("uname"); - char * battery_status= spawn("/sys/class/power_supply/BAT1/status"); - - - XXX: DONT! forget to add the varibale to sprintf() - */ - - sprintf(status, "(%s) %s", ram, TimeADate()); + sprintf(status, "(%s) %s", spawn("free -mh | awk 'NR==2{print $3\"/\"$2}'"), + TimeADate()); + XSetRoot(status); /*sleep function*/