Staninna

Untitled

Jun 29th, 2022
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. local awful = require("awful")
  2. local gears = require("gears")
  3. local wibox = require("wibox")
  4.  
  5.  
  6. local taglist_buttons = gears.table.join(
  7. awful.button(
  8. { }, 1, function(t) t:view_only() end
  9. ),
  10. awful.button(
  11. { modkey }, 1, function(t)
  12. if client.focus then
  13. client.focus:move_to_tag(t)
  14. end
  15. end
  16. ),
  17. awful.button(
  18. { }, 3, awful.tag.viewtoggle
  19. ),
  20. awful.button(
  21. { modkey }, 3, function(t)
  22. if client.focus then
  23. client.focus:toggle_tag(t)
  24. end
  25. end
  26. )
  27. )
  28.  
  29. local tasklist_buttons = gears.table.join(
  30. awful.button(
  31. { }, 1, function (c)
  32. if c == client.focus then
  33. c.minimized = true
  34. else
  35. c:emit_signal(
  36. "request::activate",
  37. "tasklist",
  38. { raise = true }
  39. )
  40. end
  41. end
  42. ),
  43. awful.button(
  44. { }, 3, function()
  45. awful.menu.client_list({ theme = { width = 250 } })
  46. end
  47. )
  48. )
  49.  
  50. -- Add bars to screens
  51. awful.screen.connect_for_each_screen(function(s)
  52.  
  53. ----------------------
  54. -- Create tag table --
  55. ----------------------
  56.  
  57. -- Each screen has its own tag table.
  58. awful.tag({ " 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 " }, s, awful.layout.layouts[1])
  59.  
  60.  
  61. --------------------
  62. -- Create widgets --
  63. --------------------
  64.  
  65. -- Create a taglist widget
  66. s.mytaglist = awful.widget.taglist {
  67. screen = s,
  68. filter = awful.widget.taglist.filter.all,
  69. buttons = taglist_buttons
  70. }
  71.  
  72. -- Create a tasklist widget
  73. s.mytasklist = awful.widget.tasklist {
  74. screen = s,
  75. filter = awful.widget.tasklist.filter.currenttags,
  76. buttons = tasklist_buttons,
  77. halign = "center"
  78. }
  79.  
  80.  
  81. --------------------
  82. -- Create wiboxes --
  83. --------------------
  84.  
  85. -- Create center bar
  86. s.bar_center = wibox {
  87. -- Placement
  88. x = s.geometry.x + (gap_size * 2) + (s.geometry.width / 4),
  89. y = s.geometry.y + (gap_size * 2),
  90.  
  91. -- Dimensions
  92. height = 25,
  93. width = s.geometry.width - (gap_size * 4) - (s.geometry.width / 4) * 2,
  94.  
  95. -- Visibility
  96. screen = s,
  97. visible = true,
  98.  
  99. -- Widgets
  100. widget = wibox.widget {
  101. widget = wibox.container.place,
  102. halign = "center",
  103. s.mytasklist
  104. }
  105. }
  106. s.bar_center:struts { top = s.bar_center.height + (gap_size * 2) }
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. -- Add widgets to the wibox
  127. -- s.bar_center:setup {
  128. -- layout = wibox.layout.fixed,
  129. -- { -- Left widgets
  130. -- layout = wibox.layout.fixed.horizontal,
  131. -- mylauncher,
  132. -- s.mytaglist,
  133. -- s.mypromptbox,
  134. -- },
  135. -- s.mytasklist, -- Middle widget
  136. -- { -- Right widgets
  137. -- layout = wibox.layout.fixed.horizontal,
  138. -- mykeyboardlayout,
  139. -- wibox.widget.systray(),
  140. -- mytextclock,
  141. -- s.mylayoutbox,
  142. -- },
  143. -- }
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. -- -- Create left bar
  155. -- s.bar_left = wibox {
  156. -- -- Placement
  157. -- x = s.geometry.x + (gap_size * 2),
  158. -- y = s.geometry.y + (gap_size * 2),
  159.  
  160. -- -- Dimensions
  161. -- height = 25,
  162. -- width = s.geometry.width - (gap_size * 4) - (s.geometry.width / 4) * 3,
  163.  
  164. -- -- Visibility
  165. -- screen = s,
  166. -- visible = true,
  167.  
  168. -- -- Widgets
  169. -- widget = wibox.widget {
  170. -- widget = wibox.container.place,
  171. -- halign = "left",
  172. -- content_fill_vertical = true,
  173. -- s.mytaglist
  174. -- },
  175. -- }
  176. -- s.bar_left:struts { top = s.bar_left.height + (gap_size * 2) }
  177.  
  178. -- -- Create right bar
  179. -- s.bar_right = wibox {
  180. -- -- Placement
  181. -- x = s.geometry.x + (gap_size * 2) + (s.geometry.width / 4) * 3,
  182. -- y = s.geometry.y + (gap_size * 2),
  183.  
  184. -- -- Visibility
  185. -- height = 25,
  186. -- width = s.geometry.width - (gap_size * 4) - (s.geometry.width / 4) * 3,
  187.  
  188. -- -- Visibility
  189. -- screen = s,
  190. -- visible = true,
  191.  
  192. -- -- Widgets
  193. -- widget = wibox.widget {
  194. -- widget = wibox.container.place,
  195. -- halign = "right",
  196. -- wibox.widget.systray()
  197. -- },
  198. -- }
  199. -- s.bar_right:struts { top = s.bar_right.height + (gap_size * 2) }
  200. end)
  201.  
Advertisement
Add Comment
Please, Sign In to add comment