Custom tasklist filter

This commit is contained in:
Thomas Avé 2022-07-23 19:13:05 +02:00
parent 5dc7127fdd
commit e526d2f962
3 changed files with 23 additions and 12 deletions

View File

@ -29,10 +29,6 @@ local task_list = require("widgets.task-list")
-- ===================================================================
local top_panel = {}
local task_lists = {layout = wibox.layout.fixed.horizontal}
awful.screen.connect_for_each_screen(function(s)
table.insert(task_lists, task_list.create(s))
end)
local updates_indicator = wibox.widget{
{
@ -98,8 +94,8 @@ top_panel.create = function(s)
panel:setup {
expand = "none",
layout = wibox.layout.align.horizontal,
task_lists,
wibox.widget{},
task_list.create(s),
nil,
{
layout = wibox.layout.fixed.horizontal,
pl(wibox.widget{}, theme.bg_normal .. "00", theme.top_panel_powerline),

View File

@ -157,15 +157,14 @@ require("awesomewm-vim-tmux-navigator") {
local handle_single_win = function(focused)
local hide = focused.maximized or focused.fullscreen
for i, c in ipairs(client.get()) do
if not c.floating and c.screen == focused.screen then
c.hidden = hide
c.minimized = hide
end
end
focused.hidden = false
focused.minimized = false
end
client.connect_signal("property::fullscreen", handle_single_win)
--
-- client.connect_signal("property::fullscreen", handle_single_win)
client.connect_signal("property::maximized", handle_single_win)

View File

@ -197,10 +197,26 @@ local tasklist_buttons = awful.util.table.join(
)
local filter = function(c, _)
local tags = c.screen.tags
for _, t in ipairs(tags) do
if t.selected then
local ctags = c:tags()
for _, v in ipairs(ctags) do
if v == t then
return true
end
end
end
end
return false
end
task_list.create = function(s)
return awful.widget.tasklist(
s,
awful.widget.tasklist.filter.currenttags,
filter,
tasklist_buttons,
{},
list_update,