]> git.mdlowis.com Git - projs/tide.git/commitdiff
modified edit command to launch registrar
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 12 Oct 2018 20:15:39 +0000 (16:15 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 12 Oct 2018 20:15:39 +0000 (16:15 -0400)
.gitignore
src/edit.c

index 57638527a236efb3f990ccc9b802187fa923243e..45e4aaf65c2f43e53afaed0a44f4463ca58828c8 100644 (file)
@@ -56,3 +56,4 @@ pty
 tctl
 flaws.txt
 edit
+registrar
index 3381668b75a4f26b3a9466534968512aa74f1332..bdcbb179f4d2a8f76d76b9ae92081ff220c754b5 100644 (file)
@@ -1,14 +1,39 @@
-#include <stdc.h>
-#include <utf.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/Xft/Xft.h>
+#include <x11.h>
 #include <unistd.h>
 
+Atom XA_REGISTRAR, XA_OPEN;
+
+void start_registrar(XConf* x) {
+    /* launch registrar if it isn't yet running */
+    if (None == XGetSelectionOwner(x.display, XA_REGISTRAR)) {
+        puts("launching registrart");
+        if (!fork()) {
+            char* cmd[] = {"registrar", NULL};
+            exit(execvp(cmd[0], cmd));
+        }
+    }
+}
+
 int main(int argc, char** argv) {
-    return 0;
+    XConf x;
+    x11_init(&x);
+    x11_mkwin(&x, 1, 1, 0);
+    XA_REGISTRAR = XInternAtom(x.display, "TIDE_REGISTRAR", 0);
+    XA_OPEN = XInternAtom(x.display, "OPEN", 0);
+    start_registrar(&x);
+    /*
+        Loop over files and send and OPEN message for each one.
+    */
+    return 1;
 }
 
+
+
+
+
+
+
+
 #if 0
 struct {
     Display* display;