From 68587e2920b52ad75f0badb4d3040b574797ac9e Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 25 Oct 2022 00:26:03 +0100 Subject: Disallow multiple simultaneous tofi instances. --- src/main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 2a9ce00..807f57c 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,7 @@ #include "input.h" #include "log.h" #include "nelem.h" +#include "lock.h" #include "shm.h" #include "string_vec.h" #include "string_vec.h" @@ -905,6 +906,11 @@ int main(int argc, char *argv[]) parse_args(&tofi, argc, argv); + if (lock_check()) { + log_error("Another instance of tofi is already running.\n"); + exit(EXIT_FAILURE); + } + /* * Initial Wayland & XKB setup. * The first thing to do is connect a listener to the global registry, -- cgit v1.2.3