+ char *path = NULL;
+ if (socket_path != NULL) {
+ path = sstrdup(socket_path);
+ }
+
+ if (path == NULL) {
+ if ((path = getenv("I3SOCK")) != NULL) {
+ path = sstrdup(path);
+ }
+ }
+
+ if (path == NULL) {
+ path = root_atom_contents("I3_SOCKET_PATH", NULL, 0);
+ }
+
+ if (path == NULL) {
+ path = sstrdup("/tmp/i3-ipc.sock");
+ }
+