aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-09-21 19:01:42 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-09-21 19:01:42 -0700
commitb6f2de2212930b2bd97935a00516dd2147421f13 (patch)
treeb0f15e4bcf4ee69da83495c7384c683a85b82ec0 /Makefile
parentf55c6a5c82733392492ab606e95e8fad6d03d478 (diff)
Added better support for custom asker/picker functionality and
simplified some of the things.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f69fdc4..ccc8cec 100644
--- a/Makefile
+++ b/Makefile
@@ -32,13 +32,20 @@ ifneq (, $(PICKER))
PICKER_FLAG=-D'PICK(prompt, initial)="pick -q \"" initial "\""'
endif
ifeq ($(shell which $(PICKER)),$(shell which dmenu 2>/dev/null || echo '<none>'))
- PICKER_FLAG=-D'PICK(prompt, initial)="dmenu -p \"" prompt "\""'
+ PICKER_FLAG=-D'PICK(prompt, initial)="dmenu -i -l 10 -p \"" prompt "\""'
endif
endif
CFLAGS += $(PICKER_FLAG)
-ifneq (, $(USE_ASK))
- CFLAGS += -D'USE_ASK=1'
+ifneq (, $(ASKER))
+ ifeq ($(shell which $(ASKER)),$(shell which ask 2>/dev/null || echo '<none>'))
+ CFLAGS += -D'ASKECHO(prompt, initial)="ask --prompt=\"" prompt "\" --query=\"" initial "\""'
+ CFLAGS += -D'ASK(var, prompt, initial)=var "=\"$$(ask --prompt=\"" prompt "\" --query=\"" initial "\")\""'
+ endif
+ ifeq ($(shell which $(ASKER)),$(shell which dmenu 2>/dev/null || echo '<none>'))
+ CFLAGS += -D'ASKECHO(prompt, initial)="{ printf \"" initial "\" | dmenu -p \"" prompt "\"; }"'
+ CFLAGS += -D'ASK(var, prompt, initial)=var "=\"$$(printf \"" initial "\" | dmenu -p \"" prompt "\")\""'
+ endif
endif
all: $(NAME)