diff options
author | Phil Jones <philj56@gmail.com> | 2022-10-25 00:26:03 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-10-25 00:26:03 +0100 |
commit | 68587e2920b52ad75f0badb4d3040b574797ac9e (patch) | |
tree | 9b0d98b165f5244e8334a2161d4aad5b747af75d /src/main.c | |
parent | a6fa0ebe77df9d1750ba3d035f55282dde9dcc87 (diff) |
Disallow multiple simultaneous tofi instances.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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, |