diff --git a/include/atoms.xmacro b/include/atoms.xmacro index 2543ffd2..2114bc3e 100644 --- a/include/atoms.xmacro +++ b/include/atoms.xmacro @@ -29,3 +29,5 @@ xmacro(WM_NAME) xmacro(WM_CLASS) xmacro(STRING) xmacro(CARDINAL) +xmacro(I3_SOCKET_PATH) +xmacro(I3_CONFIG_PATH) diff --git a/include/config.h b/include/config.h index f639df36..57970e28 100644 --- a/include/config.h +++ b/include/config.h @@ -22,6 +22,7 @@ #include "i3.h" typedef struct Config Config; +extern const char *saved_configpath; extern Config config; extern SLIST_HEAD(modes_head, Mode) modes; diff --git a/src/config.c b/src/config.c index 8f8790eb..e4a4cac9 100644 --- a/src/config.c +++ b/src/config.c @@ -19,6 +19,7 @@ #include "all.h" +const char *saved_configpath = NULL; Config config; struct modes_head modes; @@ -232,7 +233,6 @@ static char *get_config_path() { * */ static void parse_configuration(const char *override_configpath) { - static const char *saved_configpath = NULL; if (override_configpath != NULL) { saved_configpath = override_configpath; diff --git a/src/main.c b/src/main.c index 16df027b..e3b2613b 100644 --- a/src/main.c +++ b/src/main.c @@ -350,6 +350,10 @@ int main(int argc, char *argv[]) { xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTING_WM_CHECK, A_WINDOW, 32, 1, &root); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3"); + /* Set up i3 specific atoms like I3_SOCKET_PATH and I3_CONFIG_PATH */ + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_SOCKET_PATH, A_UTF8_STRING, 8, strlen(config.ipc_socket_path), config.ipc_socket_path); + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_CONFIG_PATH, A_UTF8_STRING, 8, strlen(saved_configpath), saved_configpath); + keysyms = xcb_key_symbols_alloc(conn); xcb_get_numlock_mask(conn);