--DOC_GEN_IMAGE --DOC_HIDE_START --DOC_NO_USAGE local parent = ... local wibox = require("wibox") local beautiful = require( "beautiful" ) -- luacheck: push no max line length local image_path = ''.. ''.. ' '.. ' '.. ' '.. ' '.. ' '.. ' ' .. ' '.. ' '.. ' '.. '' --luacheck: pop local function generic_widget(text) return wibox.widget { { { { id = "text", align = "center", valign = "center", text = text, widget = wibox.widget.textbox }, margins = 10, widget = wibox.container.margin, }, border_width = 3, border_color = "transparent", bg = beautiful.bg_normal, widget = wibox.container.background }, opacity = 0.5, widget = wibox.container.margin, } end --DOC_HIDE_END local w = wibox.widget { -- This is the background border. { paddings = { left = 5, top = 3, right = 10, bottom = 10, }, borders = 20, border_image = image_path, honor_borders = false, widget = wibox.container.border }, -- This border container is used top place widgets. { { text = "Center widget", valign = "center", align = "center", widget = wibox.widget.textbox }, border_widgets = { top_left = generic_widget(""), top = generic_widget("top"), top_right = generic_widget(""), right = generic_widget("right"), bottom_right = generic_widget(""), bottom = generic_widget("bottom"), bottom_left = generic_widget(""), left = generic_widget("left"), }, widget = wibox.container.border }, forced_width = 200, --DOC_HIDE forced_height = 200, --DOC_HIDE layout = wibox.layout.stack } --DOC_HIDE_START parent:add(w) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80