summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.c3
-rw-r--r--src/main.c4
-rw-r--r--src/tofi.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 1fca428..75f70b6 100644
--- a/src/config.c
+++ b/src/config.c
@@ -414,7 +414,6 @@ bool parse_option(struct tofi *tofi, const char *filename, size_t lineno, const
} else if (strcasecmp(option, "hide-input") == 0) {
tofi->window.entry.hide_input = parse_bool(filename, lineno, value, &err);
} else if (strcasecmp(option, "hidden-character") == 0) {
- /* Unicode handling is ugly. */
uint32_t ch = parse_char(filename, lineno, value, &err);
if (!err) {
tofi->window.entry.hidden_character_utf8_length =
@@ -429,6 +428,8 @@ bool parse_option(struct tofi *tofi, const char *filename, size_t lineno, const
snprintf(tofi->default_terminal, N_ELEM(tofi->default_terminal), "%s", value);
} else if (strcasecmp(option, "hint-font") == 0) {
tofi->window.entry.harfbuzz.disable_hinting = !parse_bool(filename, lineno, value, &err);
+ } else if (strcasecmp(option, "multi-instance") == 0) {
+ tofi->multiple_instance = parse_bool(filename, lineno, value, &err);
} else if (strcasecmp(option, "late-keyboard-init") == 0) {
tofi->late_keyboard_init = parse_bool(filename, lineno, value, &err);
} else if (strcasecmp(option, "output") == 0) {
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 <command> Terminal to use for command line\n"
" programs in drun mode.\n"
" --hint-font <true|false> Perform font hinting.\n"
+" --multi-instance <true|false> 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);
}
diff --git a/src/tofi.h b/src/tofi.h
index 994ee0f..d558a9b 100644
--- a/src/tofi.h
+++ b/src/tofi.h
@@ -88,6 +88,7 @@ struct tofi {
bool drun_print_exec;
bool fuzzy_match;
bool require_match;
+ bool multiple_instance;
char target_output_name[MAX_OUTPUT_NAME_LEN];
char default_terminal[MAX_TERMINAL_NAME_LEN];
};