From 0d779ef6359ff8a66b7c22ca7dee6b6097faa903 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 25 Oct 2022 00:31:25 +0100 Subject: Add --multi-instance option. --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 807f57c..c70daea 100644 --- a/src/main.c +++ b/src/main.c @@ -680,6 +680,7 @@ static void usage() " --terminal Terminal to use for command line\n" " programs in drun mode.\n" " --hint-font Perform font hinting.\n" +" --multi-instance Allow multiple tofi instances at once.\n" " --late-keyboard-init (EXPERIMENTAL) Delay keyboard\n" " initialisation until after the first\n" " draw to screen.\n" @@ -732,6 +733,7 @@ const struct option long_options[] = { {"drun-print-exec", required_argument, NULL, 0}, {"terminal", required_argument, NULL, 0}, {"hint-font", required_argument, NULL, 0}, + {"multi-instance", required_argument, NULL, 0}, {"output", required_argument, NULL, 0}, {"scale", required_argument, NULL, 0}, {"late-keyboard-init", optional_argument, NULL, 'k'}, @@ -906,7 +908,7 @@ int main(int argc, char *argv[]) parse_args(&tofi, argc, argv); - if (lock_check()) { + if (!tofi.multiple_instance && lock_check()) { log_error("Another instance of tofi is already running.\n"); exit(EXIT_FAILURE); } -- cgit v1.2.3