no-op refactoring: make ipc_connect find socket path

This commit is contained in:
Michael Stapelberg
2017-11-26 16:41:59 +01:00
parent 2eabfc88fe
commit c07936d91b
5 changed files with 28 additions and 63 deletions

View File

@ -94,7 +94,7 @@ static xcb_get_modifier_mapping_reply_t *modmap_reply;
static i3Font font;
static i3Font bold_font;
static int char_width;
static char *socket_path;
static char *socket_path = NULL;
static xcb_window_t win;
static surface_t surface;
static xcb_key_symbols_t *symbols;
@ -744,7 +744,6 @@ static void finish() {
int main(int argc, char *argv[]) {
char *xdg_config_home;
socket_path = getenv("I3SOCK");
char *pattern = "pango:monospace 8";
char *patternbold = "pango:monospace bold 8";
int o, option_index = 0;
@ -824,12 +823,6 @@ int main(int argc, char *argv[]) {
&xkb_base_error) != 1)
errx(EXIT_FAILURE, "Could not setup XKB extension.");
if (socket_path == NULL)
socket_path = root_atom_contents("I3_SOCKET_PATH", conn, screen);
if (socket_path == NULL)
socket_path = "/tmp/i3-ipc.sock";
keysyms = xcb_key_symbols_alloc(conn);
xcb_get_modifier_mapping_cookie_t modmap_cookie;
modmap_cookie = xcb_get_modifier_mapping(conn);