]> git.sur5r.net Git - i3/i3/blobdiff - i3-msg/main.c
Use I3SOCK-environment-variable
[i3/i3] / i3-msg / main.c
index a2cd9e0a88558e53dee18d90669fb565845dfa0e..6a51ff557b7254f5c281f9e0b5f85102c5b164cb 100644 (file)
@@ -107,7 +107,10 @@ static void ipc_recv_message(int sockfd, uint32_t message_type,
 }
 
 int main(int argc, char *argv[]) {
-        char *socket_path = "/tmp/i3-ipc.sock";
+        char *socket_path;
+        if ((socket_path = getenv("I3SOCK")) == NULL) {
+            socket_path = "/tmp/i3-ipc.sock";
+        }
         int o, option_index = 0;
         int message_type = I3_IPC_MESSAGE_TYPE_COMMAND;
         char *payload = "";