From 4212fb6488578e332a5f3cad2819beedb0ff7ae5 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Tue, 14 Apr 2020 20:46:49 +0200 Subject: [PATCH] i3bar: Set WM_CLASS instance to bar_id --- i3bar/src/xcb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 06cff98d..ae447fbc 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -1816,6 +1816,8 @@ void reconfig_windows(bool redraw_bars) { bar_height); /* Set the WM_CLASS and WM_NAME (we don't need UTF-8) atoms */ + char *class; + int len = sasprintf(&class, "%s%ci3bar%c", config.bar_id, 0, 0); xcb_void_cookie_t class_cookie; class_cookie = xcb_change_property(xcb_connection, XCB_PROP_MODE_REPLACE, @@ -1823,8 +1825,8 @@ void reconfig_windows(bool redraw_bars) { XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8, - (strlen("i3bar") + 1) * 2, - "i3bar\0i3bar\0"); + len, + class); char *name; sasprintf(&name, "i3bar for output %s", walk->name);