diff --git a/client.c b/client.c index 716c3acee..47294ed6a 100644 --- a/client.c +++ b/client.c @@ -1193,6 +1193,7 @@ luaA_client_newindex(lua_State *L) * \lfield instance The client instance. * \lfield pid The client PID, 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. * \lfield screen Client screen number. * \lfield hide Define if the client must be hidden, i.e. never mapped. @@ -1260,6 +1261,13 @@ luaA_client_index(lua_State *L) lua_pushlstring(L, value, slen); p_delete(&value); break; + case A_TK_ICON_NAME: + if(!xutil_gettextprop(globalconf.connection, (*c)->win, _NET_WM_ICON_NAME, &value, &slen)) + if(!xutil_gettextprop(globalconf.connection, (*c)->win, WM_ICON_NAME, &value, &slen)) + return 0; + lua_pushlstring(L, value, slen); + p_delete(&value); + break; case A_TK_FLOATING_PLACEMENT: lua_pushstring(L, name_func_rlookup((*c)->floating_placement, FloatingPlacementList)); diff --git a/common/tokenize.gperf b/common/tokenize.gperf index e9d40b280..3bf316f94 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -27,6 +27,7 @@ grow height hide honorsizehints +icon_name icon_path image instance diff --git a/lib/awful.lua.in b/lib/awful.lua.in index c3f2a3eeb..2cb01d9f3 100644 --- a/lib/awful.lua.in +++ b/lib/awful.lua.in @@ -1119,15 +1119,21 @@ local function widget_tasklist_label_common(c, args) local fg_urgent = args.fg_urgent or theme.fg_urgent local bg_urgent = args.bg_urgent or theme.bg_urgent local text = "" + local name if c.floating then text = "" end - if capi.client.focus_get() == c then - text = text .. " "..escape(c.name).." " - elseif c.urgent and bg_urgent and fg_urgent then - text = text .. " "..escape(c.name).." " + if c.hidden then + name = escape(c.icon_name) else - text = text .. " "..escape(c.name).." " + name = escape(c.name) + end + if capi.client.focus_get() == c then + text = text .. " "..name.." " + elseif c.urgent and bg_urgent and fg_urgent then + text = text .. " "..name.." " + else + text = text .. " "..name.." " end return text end