Use I3SOCK-environment-variable

This commit is contained in:
Axel Wagner
2011-01-11 04:39:48 +01:00
committed by Michael Stapelberg
parent cd2ee61ee8
commit 4caf85aa0b
8 changed files with 42 additions and 4 deletions

View 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 = "";