summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-10-25 00:26:03 +0100
committerPhil Jones <philj56@gmail.com>2022-10-25 00:26:03 +0100
commit68587e2920b52ad75f0badb4d3040b574797ac9e (patch)
tree9b0d98b165f5244e8334a2161d4aad5b747af75d /src/main.c
parenta6fa0ebe77df9d1750ba3d035f55282dde9dcc87 (diff)
Disallow multiple simultaneous tofi instances.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
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,