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 instance The client instance.
* \lfield pid The client PID, if available. * \lfield pid The client PID, if available.
* \lfield machine The machine client is running on. * \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 floating_placement The floating placement used for this client.
* \lfield screen Client screen number. * \lfield screen Client screen number.
* \lfield hide Define if the client must be hidden, i.e. never mapped. * \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); lua_pushlstring(L, value, slen);
p_delete(&value); p_delete(&value);
break; 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: case A_TK_FLOATING_PLACEMENT:
lua_pushstring(L, name_func_rlookup((*c)->floating_placement, lua_pushstring(L, name_func_rlookup((*c)->floating_placement,
FloatingPlacementList)); FloatingPlacementList));

View File

@ -27,6 +27,7 @@ grow
height height
hide hide
honorsizehints honorsizehints
icon_name
icon_path icon_path
image image
instance 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 fg_urgent = args.fg_urgent or theme.fg_urgent
local bg_urgent = args.bg_urgent or theme.bg_urgent local bg_urgent = args.bg_urgent or theme.bg_urgent
local text = "" local text = ""
local name
if c.floating then if c.floating then
text = "<bg image=\"@AWESOME_ICON_PATH@/tasklist/floatingw.png\" align=\"right\"/>" text = "<bg image=\"@AWESOME_ICON_PATH@/tasklist/floatingw.png\" align=\"right\"/>"
end end
if capi.client.focus_get() == c then if c.hidden then
text = text .. " <bg color='"..bg_focus.."'/><span color='"..fg_focus.."'>"..escape(c.name).."</span> " name = escape(c.icon_name)
elseif c.urgent and bg_urgent and fg_urgent then
text = text .. " <bg color='"..bg_urgent.."'/><span color='"..fg_urgent.."'>"..escape(c.name).."</span> "
else 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 end
return text return text
end end