From 0f0bacceb4e03547755fb5e05f3d5923b81614cb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 22 Sep 2019 17:51:27 -0700 Subject: Now $@ is *always* the selected files, even if there are none. Cleaned up the default bindings a bit to be more explicit about manipulating the cursor file vs. manipulated selected files. Added support for `ask -n` and generally confirming with a single 'y' keystroke instead of 'y' Also added a binding for `rename`-command batch renaming. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c72bf46..e3ce213 100644 --- a/Makefile +++ b/Makefile @@ -42,8 +42,10 @@ endif CFLAGS += $(PICKER_FLAG) ifneq (, $(ASKER)) + PERCENT := % ifeq ($(shell which $(ASKER)),$(shell which ask 2>/dev/null || echo '')) CFLAGS += -D'ASK(var, prompt, initial)=var "=\"$$(ask --history=bb."STRINGIFY(__COUNTER__)".hist --prompt=\"" prompt "\" --query=\"" initial "\")\""' + CFLAGS += -D'CONFIRM(action, files)=" { printf \"$(PERCENT)s\\n\" \""B(action)"\" \""files"\" | more; ask -n \"Is that okay?\"; } "' endif ifeq ($(shell which $(ASKER)),$(shell which dmenu 2>/dev/null || echo '')) CFLAGS += -D'ASK(var, prompt, initial)=var "=\"$$(printf \"" initial "\" | dmenu -p \"" prompt "\")\""' -- cgit v1.2.3