]> git.sur5r.net Git - i3/i3/commitdiff
Make path configurable
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 28 Jul 2009 20:09:53 +0000 (22:09 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 28 Jul 2009 20:09:53 +0000 (22:09 +0200)
Makefile
include/config.h
src/config.c
src/mainx.c

index 8666d9eff3ee8b60abe21da939fe6fe05c841bfb..850693e3463dd0f00336038226504337dd303cd3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ install: all
        $(INSTALL) -m 0755 i3 $(DESTDIR)/usr/bin/
        test -e $(DESTDIR)/etc/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)/etc/i3/config
        $(INSTALL) -m 0644 i3.desktop $(DESTDIR)/usr/share/xsessions/
-       $(MAKE) TOPDIR=$(TOPDIR) -C i3-msg
+       $(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
 
 dist: clean
        [ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION}
index 80fa2f0247551838a5a3a1ebb0403a909bef1732..cfedfdb88bccc9b395b9992ec74301e391720adb 100644 (file)
@@ -53,6 +53,8 @@ struct Config {
         const char *terminal;
         const char *font;
 
+        const char *ipc_socket_path;
+
         /** The modifier which needs to be pressed in combination with your mouse
          * buttons to do things with floating windows (move, resize) */
         uint32_t floating_modifier;
index fc5fa6478604e263a00446cd436e4f39e8052ff6..2f78dec99244f53ce3dbe137d31afad9fc401f18 100644 (file)
@@ -408,6 +408,11 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
                         continue;
                 }
 
+                if (strcasecmp(key, "ipc-socket") == 0) {
+                        config.ipc_socket_path = sstrdup(value);
+                        continue;
+                }
+
                 die("Unknown configfile option: %s\n", key);
         }
         /* now grab all keys again */
index 684526c653059886e8675dde406970d0069281fa..03cb9d1b647d53034ec3e9abb0c63c6c679d70fb 100644 (file)
@@ -370,13 +370,15 @@ int main(int argc, char *argv[], char *env[]) {
         }
 
         /* Create the UNIX domain socket for IPC */
-        int ipc_socket = ipc_create_socket("/tmp/i3.s");
-        if (ipc_socket == -1) {
-                LOG("Could not create the IPC socket, IPC disabled\n");
-        } else {
-                struct ev_io *ipc_io = scalloc(sizeof(struct ev_io));
-                ev_io_init(ipc_io, ipc_new_client, ipc_socket, EV_READ);
-                ev_io_start(loop, ipc_io);
+        if (config.ipc_socket_path != NULL) {
+                int ipc_socket = ipc_create_socket(config.ipc_socket_path);
+                if (ipc_socket == -1) {
+                        LOG("Could not create the IPC socket, IPC disabled\n");
+                } else {
+                        struct ev_io *ipc_io = scalloc(sizeof(struct ev_io));
+                        ev_io_init(ipc_io, ipc_new_client, ipc_socket, EV_READ);
+                        ev_io_start(loop, ipc_io);
+                }
         }
 
         /* Handle the events which arrived until now */