dotfiles/awesome/powerline.lua

33 lines
1010 B
Lua
Raw Normal View History

2022-07-22 14:47:26 +02:00
local lain = require("lain")
local wibox = require("wibox")
local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi
-- ===================================================================
-- Helper functions
-- ===================================================================
local function powerline(widget, bgcolor, adjacentcolor, right)
right = right or false
local container = {
layout = wibox.layout.fixed.horizontal,
wibox.layout.margin(widget, dpi(6), dpi(10)),
}
if (not right) then
table.insert(container, lain.util.separators.arrow_left(bgcolor, adjacentcolor))
else
table.insert(container, lain.util.separators.arrow_right(bgcolor, adjacentcolor))
end
return wibox.widget{
{
container,
bg = bgcolor,
widget = wibox.container.background
},
top = 0, bottom = 0, left = 0, right = 0,
widget = wibox.container.margin
}
end
return powerline