diff options
-rw-r--r-- | sway/ipc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -40,10 +40,13 @@ void init_ipc() { | |||
40 | 40 | ||
41 | struct sockaddr_un ipc_sockaddr = { | 41 | struct sockaddr_un ipc_sockaddr = { |
42 | .sun_family = AF_UNIX, | 42 | .sun_family = AF_UNIX, |
43 | // TODO: use a proper socket path | 43 | .sun_path = "/tmp/sway-ipc.sock" |
44 | .sun_path = "/tmp/sway.sock" | ||
45 | }; | 44 | }; |
46 | 45 | ||
46 | if (getenv("SWAYSOCK") != NULL) { | ||
47 | strncpy(ipc_sockaddr.sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr.sun_path)); | ||
48 | } | ||
49 | |||
47 | unlink(ipc_sockaddr.sun_path); | 50 | unlink(ipc_sockaddr.sun_path); |
48 | if (bind(ipc_socket, (struct sockaddr *)&ipc_sockaddr, sizeof(ipc_sockaddr)) == -1) { | 51 | if (bind(ipc_socket, (struct sockaddr *)&ipc_sockaddr, sizeof(ipc_sockaddr)) == -1) { |
49 | sway_abort("Unable to bind IPC socket"); | 52 | sway_abort("Unable to bind IPC socket"); |