diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 132933e68..30b307747 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -248,7 +248,16 @@ keybinding({ modkey, "Ctrl" }, "i", function () if mypromptbox.text then mypromptbox.text = nil else - mypromptbox.text = "Class: " .. client.focus.class .. " Instance: ".. client.focus.instance + mypromptbox.text = nil + if client.focus.class then + mypromptbox.text = "Class: " .. client.focus.class .. " " + end + if client.focus.instance then + mypromptbox.text = mypromptbox.text .. "Instance: ".. client.focus.instance .. " " + end + if client.focus.role then + mypromptbox.text = mypromptbox.text .. "Role: ".. client.focus.role + end end end):add() diff --git a/client.c b/client.c index eedd1a6d3..6bd1f251e 100644 --- a/client.c +++ b/client.c @@ -1257,6 +1257,7 @@ luaA_client_newindex(lua_State *L) * \lfield class The client class. * \lfield instance The client instance. * \lfield pid The client PID, if available. + * \lfield role The window role, if available. * \lfield machine The machine client is running on. * \lfield icon_name The client name when iconified. * \lfield floating_placement The floating placement used for this client. @@ -1307,6 +1308,13 @@ luaA_client_index(lua_State *L) return 0; lua_pushstring(L, hint.res_name); break; + case A_TK_ROLE: + if(!xutil_text_prop_get(globalconf.connection, (*c)->win, + WM_WINDOW_ROLE, &value, &slen)) + return 0; + lua_pushlstring(L, value, slen); + p_delete(&value); + break; case A_TK_PID: prop_c = xcb_get_property_unchecked(globalconf.connection, false, (*c)->win, _NET_WM_PID, CARDINAL, 0L, 1L); prop_r = xcb_get_property_reply(globalconf.connection, prop_c, NULL); diff --git a/common/atoms.list b/common/atoms.list index d4d85086b..cc3dc7495 100644 --- a/common/atoms.list +++ b/common/atoms.list @@ -44,3 +44,4 @@ WM_STATE _NET_WM_WINDOW_OPACITY _NET_SYSTEM_TRAY_ORIENTATION WM_CHANGE_STATE +WM_WINDOW_ROLE diff --git a/common/tokenize.gperf b/common/tokenize.gperf index fd332f2ee..fe5e28d2f 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -45,6 +45,7 @@ plot_properties_set position resize right +role screen selected shadow