diff --git a/README.md b/README.md index 8ce5cf200ffa58f82eaf20b7d21b12cad1d31cd8..1a87935ebb231993eb8d17558903ed12d07b8055 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 9dd3b8102a98dcfba483bdc67b946d5ca37e0e36..aa5efb555c0e73a1f88764857654fa80323e08d1 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