From caca38b68e4bcfcdfae0a17694f2a4d087200053 Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Tue, 11 Jan 2011 05:02:55 +0100 Subject: [PATCH] Use I3SOCK environment-variable --- i3bar/doc/i3bar.man | 8 ++++++++ i3bar/src/main.c | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/i3bar/doc/i3bar.man b/i3bar/doc/i3bar.man index 9ee7f7ce..d446143c 100644 --- a/i3bar/doc/i3bar.man +++ b/i3bar/doc/i3bar.man @@ -54,6 +54,14 @@ For each specified option you need to give a HEX-colorcode. Be advised that this command-line-options are only temporary and are very likely to be removed, when we finally have a config-file. +== ENVIRONMENT + +=== I3SOCK + +If no ipc-socket is specified on the commandline, this variable is used +to determine the path, at wich the unix domain socket is expected, on which +to connect to i3. + == EXAMPLES To get a docked bar with some statusinformation, you use diff --git a/i3bar/src/main.c b/i3bar/src/main.c index fce7fc29..c0e07a22 100644 --- a/i3bar/src/main.c +++ b/i3bar/src/main.c @@ -113,7 +113,7 @@ void sig_cb(struct ev_loop *loop, ev_signal *watcher, int revents) { int main(int argc, char **argv) { int opt; int option_index = 0; - char *socket_path = NULL; + char *socket_path = getenv("I3SOCK"); char *command = NULL; char *fontname = NULL; char *i3_default_sock_path = "~/.i3/ipc.sock"; @@ -247,8 +247,6 @@ int main(int argc, char **argv) { kill_child(); - FREE(socket_path); - FREE(statusline_buffer); clean_xcb(); -- 2.39.5