summaryrefslogtreecommitdiff
path: root/hosts/mac/kmonad-daemon-shim/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/mac/kmonad-daemon-shim/main.c')
-rw-r--r--hosts/mac/kmonad-daemon-shim/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hosts/mac/kmonad-daemon-shim/main.c b/hosts/mac/kmonad-daemon-shim/main.c
new file mode 100644
index 0000000..a9f0596
--- /dev/null
+++ b/hosts/mac/kmonad-daemon-shim/main.c
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+char *const kdv_client[] = {"@client@"};
+
+int main(int argc, char *argv[]) {
+ int r = fork();
+ if (r < 0) {
+ perror("kmonad-service-shim: fork");
+ return 1;
+ } else if (r == 0) {
+ r = execvp(kdv_client[0], kdv_client);
+ } else {
+ // To give time for kdv-client to start
+ sleep(1);
+ r = execvp("kmonad", argv);
+ };
+ if (r < 0) {
+ perror("kmonad-service-shim: execvp");
+ return 1;
+ }
+}