clients: add icon_name support

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-11 11:41:42 +02:00
parent 32167500c6
commit fb093696bb
3 changed files with 20 additions and 5 deletions

View File

@ -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));

View File

@ -27,6 +27,7 @@ grow
height
hide
honorsizehints
icon_name
icon_path
image
instance

View File

@ -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 = "<bg image=\"@AWESOME_ICON_PATH@/tasklist/floatingw.png\" align=\"right\"/>"
end
if capi.client.focus_get() == c then
text = text .. " <bg color='"..bg_focus.."'/><span color='"..fg_focus.."'>"..escape(c.name).."</span> "
elseif c.urgent and bg_urgent and fg_urgent then
text = text .. " <bg color='"..bg_urgent.."'/><span color='"..fg_urgent.."'>"..escape(c.name).."</span> "
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 .. " <bg color='"..bg_focus.."'/><span color='"..fg_focus.."'>"..name.."</span> "
elseif c.urgent and bg_urgent and fg_urgent then
text = text .. " <bg color='"..bg_urgent.."'/><span color='"..fg_urgent.."'>"..name.."</span> "
else
text = text .. " "..name.." "
end
return text
end