Reno is the second iteration of the AWMTK-powered AwesomeWM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.2 KiB

2 years ago
  1. -- Base for widgets
  2. local awmtk2 = require("awmtk2")
  3. local wibox = require("wibox")
  4. local gears = require("gears")
  5. local awful = require("awful")
  6. local beautiful = require("beautiful")
  7. return function(args)
  8. local style = awmtk2.create_style("taglist",awmtk2.default,args.style)
  9. local templates = awmtk2.create_template_lib("taglist",awmtk2.templates,args.templates)
  10. local t = awmtk2.build_templates(templates,style)
  11. local widget = wibox.widget(t.container(awful.widget.taglist({
  12. screen = args.screen,
  13. filter = awful.widget.taglist.filter.all,
  14. style = {
  15. shape = style.button.shape
  16. },
  17. layout = {
  18. spacing = style.base.spacing,
  19. spacing_widget = style.base.spacing_widget,
  20. layout = style.base.layout or wibox.layout.fixed.horizontal
  21. },
  22. widget_template = t.button(t.article({
  23. icon_id = "icon_role",
  24. title_id = "text_role"
  25. }),{
  26. id = "background",
  27. create_callback = function(self, tag, index, tags)
  28. self:connect_signal("button::press",function(self,x,y,b)
  29. if b == 1 then
  30. awful.tag.viewmore({tag})
  31. elseif b == 3 then
  32. awful.tag.viewtoggle(tag)
  33. end
  34. end)
  35. local bg = self:get_children_by_id("background")[1]
  36. if tag.selected then
  37. bg.bgimage = style.button.bgimage_focus
  38. bg.bg = style.button.bg_focus
  39. else
  40. bg.bgimage = style.button.bgimage_normal
  41. bg.bg = style.button.bg_normal
  42. end
  43. end,
  44. update_callback = function(self, tag, index, tags)
  45. local bg = self:get_children_by_id("background")[1]
  46. if tag.selected then
  47. bg.bgimage = style.button.bgimage_focus
  48. bg.bg = style.button.bg_focus
  49. else
  50. bg.bgimage = style.button.bgimage_normal
  51. bg.bg = style.button.bg_normal
  52. end
  53. end
  54. })
  55. })))
  56. return widget
  57. end