Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local awful = require("awful")
- local gears = require("gears")
- local wibox = require("wibox")
- local taglist_buttons = gears.table.join(
- awful.button(
- { }, 1, function(t) t:view_only() end
- ),
- awful.button(
- { modkey }, 1, function(t)
- if client.focus then
- client.focus:move_to_tag(t)
- end
- end
- ),
- awful.button(
- { }, 3, awful.tag.viewtoggle
- ),
- awful.button(
- { modkey }, 3, function(t)
- if client.focus then
- client.focus:toggle_tag(t)
- end
- end
- )
- )
- local tasklist_buttons = gears.table.join(
- awful.button(
- { }, 1, function (c)
- if c == client.focus then
- c.minimized = true
- else
- c:emit_signal(
- "request::activate",
- "tasklist",
- { raise = true }
- )
- end
- end
- ),
- awful.button(
- { }, 3, function()
- awful.menu.client_list({ theme = { width = 250 } })
- end
- )
- )
- -- Add bars to screens
- awful.screen.connect_for_each_screen(function(s)
- ----------------------
- -- Create tag table --
- ----------------------
- -- Each screen has its own tag table.
- awful.tag({ " 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 " }, s, awful.layout.layouts[1])
- --------------------
- -- Create widgets --
- --------------------
- -- Create a taglist widget
- s.mytaglist = awful.widget.taglist {
- screen = s,
- filter = awful.widget.taglist.filter.all,
- buttons = taglist_buttons
- }
- -- Create a tasklist widget
- s.mytasklist = awful.widget.tasklist {
- screen = s,
- filter = awful.widget.tasklist.filter.currenttags,
- buttons = tasklist_buttons,
- halign = "center"
- }
- --------------------
- -- Create wiboxes --
- --------------------
- -- Create center bar
- s.bar_center = wibox {
- -- Placement
- x = s.geometry.x + (gap_size * 2) + (s.geometry.width / 4),
- y = s.geometry.y + (gap_size * 2),
- -- Dimensions
- height = 25,
- width = s.geometry.width - (gap_size * 4) - (s.geometry.width / 4) * 2,
- -- Visibility
- screen = s,
- visible = true,
- -- Widgets
- widget = wibox.widget {
- widget = wibox.container.place,
- halign = "center",
- s.mytasklist
- }
- }
- s.bar_center:struts { top = s.bar_center.height + (gap_size * 2) }
- -- Add widgets to the wibox
- -- s.bar_center:setup {
- -- layout = wibox.layout.fixed,
- -- { -- Left widgets
- -- layout = wibox.layout.fixed.horizontal,
- -- mylauncher,
- -- s.mytaglist,
- -- s.mypromptbox,
- -- },
- -- s.mytasklist, -- Middle widget
- -- { -- Right widgets
- -- layout = wibox.layout.fixed.horizontal,
- -- mykeyboardlayout,
- -- wibox.widget.systray(),
- -- mytextclock,
- -- s.mylayoutbox,
- -- },
- -- }
- -- -- Create left bar
- -- s.bar_left = wibox {
- -- -- Placement
- -- x = s.geometry.x + (gap_size * 2),
- -- y = s.geometry.y + (gap_size * 2),
- -- -- Dimensions
- -- height = 25,
- -- width = s.geometry.width - (gap_size * 4) - (s.geometry.width / 4) * 3,
- -- -- Visibility
- -- screen = s,
- -- visible = true,
- -- -- Widgets
- -- widget = wibox.widget {
- -- widget = wibox.container.place,
- -- halign = "left",
- -- content_fill_vertical = true,
- -- s.mytaglist
- -- },
- -- }
- -- s.bar_left:struts { top = s.bar_left.height + (gap_size * 2) }
- -- -- Create right bar
- -- s.bar_right = wibox {
- -- -- Placement
- -- x = s.geometry.x + (gap_size * 2) + (s.geometry.width / 4) * 3,
- -- y = s.geometry.y + (gap_size * 2),
- -- -- Visibility
- -- height = 25,
- -- width = s.geometry.width - (gap_size * 4) - (s.geometry.width / 4) * 3,
- -- -- Visibility
- -- screen = s,
- -- visible = true,
- -- -- Widgets
- -- widget = wibox.widget {
- -- widget = wibox.container.place,
- -- halign = "right",
- -- wibox.widget.systray()
- -- },
- -- }
- -- s.bar_right:struts { top = s.bar_right.height + (gap_size * 2) }
- end)
Advertisement
Add Comment
Please, Sign In to add comment