Added default clienticon

This commit is contained in:
2023-09-03 09:26:07 -07:00
parent 73881d7d05
commit 638f1efc3a
5 changed files with 150 additions and 4 deletions

View File

@ -64,7 +64,10 @@ tasklist.make = function(screen)
fill_vertical = true,
{
id = "clienticon",
widget = awful.widget.clienticon,
-- Don't use awesomewm's stock clienticon.
-- using a raw imagebox lets us handle nil icons...
-- also, see th call to awesome.preferred_icon_size in rc.lua.
widget = wibox.widget.imagebox,
},
},
margins = beautiful.dpi(3),
@ -79,8 +82,24 @@ tasklist.make = function(screen)
-- The create callback is only called once, when the task indicator
-- is created.
create_callback = function(self, c, index, objects)
-- Set indicator icon
self:get_children_by_id("clienticon")[1].client = c
if c.icon == nil then
self:get_children_by_id("clienticon")[1].image = beautiful.icons[config.core.default_clienticon]
else
self:get_children_by_id("clienticon")[1].image = c.icon
end
self:get_children_by_id("clienticon")[1]:emit_signal("widget::redraw_needed")
-- Update top color
if c == client.focus then
self:get_children_by_id("top_tab")[1].bg = "#2DA0DA"
elseif c.minimized then
self:get_children_by_id("top_tab")[1].bg = beautiful.color.bar.hover_bg --beautiful.color.transparent
else
self:get_children_by_id("top_tab")[1].bg = "#2DA0DA77"
end
-- Change background when mouse is over widget
self:connect_signal("mouse::enter", function(result)
@ -106,7 +125,13 @@ tasklist.make = function(screen)
update_callback = function(self, c, index, objects)
-- Update indicator icon
self:get_children_by_id("clienticon")[1].client = c
if c.icon == nil then
self:get_children_by_id("clienticon")[1].image = beautiful.icons[config.core.default_clienticon]
else
self:get_children_by_id("clienticon")[1].image = c.icon
end
self:get_children_by_id("clienticon")[1]:emit_signal("widget::redraw_needed")
-- Update top color
if c == client.focus then