From 3e6bcb386cc9df28990b9cd570f6df7617e91f91 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 14 Oct 2023 00:25:32 -0700 Subject: sars,hungrycat: add --wait flag This tells sars to just wait indefinitely until an ESC is pressed pre-fadein during the opening hungrycat context. The --delay [seconds] flag was added to facilitate screen captures, but it's actually rather annoying to use. This way the sars window will just sit there ignoring any spurious events waiting for an ESC to proceed onto DELAY->FADEIN... Probably not useful but technically this composes with --delay as well, such that if you have --delay and --wait specified, once you hit ESC to leave the WAIT state, the delay will then begin. --- src/sars.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sars.c') diff --git a/src/sars.c b/src/sars.c index 0c6295e..21f87e3 100644 --- a/src/sars.c +++ b/src/sars.c @@ -260,10 +260,12 @@ static int sars_parse_argv(sars_t *sars, int argc, char *argv[]) sars->delay_seconds = SARS_DEFAULT_DELAY_SECS; if (i + 1 < argc && argv[i + 1][0] != '-' && argv[i + 1][1] != '-') { - /* --wait SECONDS is optionally supported */ + /* --delay SECONDS is optionally supported */ sscanf(argv[i + 1], "%u", &sars->delay_seconds); /* FIXME: parse errors */ i++; } + } else if (!strcmp(flag, "--wait")) { + sars->wait = 1; } else { warn_if(1, "Unsupported flag \"%s\", ignoring", argv[i]); } /* TODO: add --fullscreen? */ -- cgit v1.2.3