File: _wibox_helper.lua

package info (click to toggle)
awesome 4.3-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,468 kB
  • sloc: ansic: 14,508; sh: 526; makefile: 46
file content (40 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
local awful = require("awful")
local cairo = require("lgi").cairo
local wibox = require("wibox")

return { create_wibox = function()
    local img = cairo.ImageSurface(cairo.Format.ARGB32, 20, 20)

    -- Widgets that are aligned to the left
    local left_layout = wibox.layout.fixed.horizontal()
    left_layout:add(awful.widget.launcher({ image = img, command = "bash" }))
    left_layout:add(awful.widget.taglist {
        screen = 1,
        filter = awful.widget.taglist.filter.all
    })
    left_layout:add(awful.widget.prompt())

    -- Widgets that are aligned to the right
    local right_layout = wibox.layout.fixed.horizontal()
    local textclock = wibox.widget.textclock()
    right_layout:add(textclock)
    right_layout:add(awful.widget.layoutbox(1))

    -- Now bring it all together (with the tasklist in the middle)
    local layout = wibox.layout.align.horizontal()
    layout:set_left(left_layout)
    layout:set_middle(awful.widget.tasklist {
        screen = 1,
        filter = awful.widget.tasklist.filter.currenttags
    })
    layout:set_right(right_layout)

    -- Create wibox
    local wb = wibox({ width = 1024, height = 20, screen = 1 })
    --wb.visible = true
    wb:set_widget(layout)

    return wb, textclock, img, left_layout, right_layout, layout
end }

-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80