Give bar control over input generating command.

When the bar is getting input from a loop with a pause, there
can be a noticable delay to visually updating the bar on click
events. By letting bar call an input command it can now update
instantly on a click event and still have a delay so it's not
an idle hog.

Something like:
while true; do date; sleep 10; done | bar -d

Now becomes:
bar -d -c "date" -t 10

Either option may be ommited and the bar will still perform as
before. If a command (-c) is given but not a timeout (-t) then
the timeout defaults to 5 seconds.

Changed compiler standard to gnu99 for use with popen()/pclose()
This commit is contained in:
Jason Moggridge
2016-04-23 22:55:53 -04:00
parent 40f08d5245
commit 6ce01bb31c
2 changed files with 64 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ ifneq "$(GIT_DESC)" ""
endif
CC ?= gcc
CFLAGS += -Wall -std=c99 -Os -DVERSION="\"$(VERSION)\""
CFLAGS += -Wall -std=gnu99 -Os -DVERSION="\"$(VERSION)\""
LDFLAGS += -lxcb -lxcb-xinerama -lxcb-randr
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long \
-Wsign-conversion -Wconversion -Wimplicit-function-declaration