awful.widget.taglist: support for 'hide' property
This allows setting 'hide' property for a tag to prevent it from showing in the taglist. Signed-off-by: koniu <gkusnierz@gmail.com> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7f828b5db3
commit
eae6b8066f
|
@ -13,6 +13,7 @@ local type = type
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
|
local table = table
|
||||||
local hooks = require("awful.hooks")
|
local hooks = require("awful.hooks")
|
||||||
local common = require("awful.widget.common")
|
local common = require("awful.widget.common")
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
|
@ -26,7 +27,13 @@ label = {}
|
||||||
|
|
||||||
local function taglist_update (screen, w, label, buttons, data, widgets)
|
local function taglist_update (screen, w, label, buttons, data, widgets)
|
||||||
local tags = capi.screen[screen]:tags()
|
local tags = capi.screen[screen]:tags()
|
||||||
common.list_update(w, buttons, label, data, widgets, tags)
|
local showntags = {}
|
||||||
|
for k, t in ipairs(tags) do
|
||||||
|
if not tag.getproperty(t, "hide") then
|
||||||
|
table.insert(showntags, t)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
common.list_update(w, buttons, label, data, widgets, showntags)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the tag object the given widget appears on.
|
--- Get the tag object the given widget appears on.
|
||||||
|
@ -62,7 +69,8 @@ function new(screen, label, buttons)
|
||||||
hooks.tagged.register(uc)
|
hooks.tagged.register(uc)
|
||||||
hooks.property.register(function (c, prop)
|
hooks.property.register(function (c, prop)
|
||||||
if (type(c) == "client" and prop == "urgent")
|
if (type(c) == "client" and prop == "urgent")
|
||||||
or (type(c) == "tag" and prop == "icon") then
|
or (type(c) == "tag" and
|
||||||
|
(prop == "icon" or prop == "hide")) then
|
||||||
u(c.screen)
|
u(c.screen)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue