From a628862869ffd24dca0f4f3f73d8297cd6a8964d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com> Date: Fri, 28 Feb 2020 15:19:50 +0100 Subject: [PATCH] Fix bug where the tagbar was duplicated for all screens --- README.md | 4 ++-- taggrid.lua | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ce5cf2..1a87935 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ s.mytaglist = awful.widget.taglist{ screen = s, filter = awful.widget.taglist.filter.all, buttons = taglist_buttons, - layout = taggrid.gridlayout + layout = taggrid.getlayout() } ``` @@ -158,4 +158,4 @@ Add "Shift" for shifting the currently focused client. Scrolling on the tagbar will cycle through all tags, using the movement keys it will wrap around on the current row. Similar behaviour for shifting clients. -See `taggridkeys.lua` for more details. \ No newline at end of file +See `taggridkeys.lua` for more details. diff --git a/taggrid.lua b/taggrid.lua index 9dd3b81..aa5efb5 100644 --- a/taggrid.lua +++ b/taggrid.lua @@ -25,9 +25,9 @@ taggrid.tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]", " "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]", "←" } - +function taggrid.getlayout() -- Create a gridlayout for the above tags - taggrid.gridlayout = wibox.widget { + local layout = wibox.widget { forced_num_cols = taggrid.tag_offset, forced_num_rows = taggrid.tag_column_count, --min_rows_size = 10, @@ -36,6 +36,9 @@ taggrid.tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]", " layout = wibox.layout.grid } + return layout +end + -- View the next tag to the left, wrapping on the current row -- Replacing awful.tag.viewprev function taggrid.viewprev() @@ -82,6 +85,8 @@ function taggrid.viewnext() tag = screen.tags[curidx + 1] end if tag then + -- Can be replaced with awful.tag.viewidx(i,[screen]) + -- view_only() is deprecated tag:view_only() end end -- GitLab