dotfiles/.config/awesome/ui/top-panel/init.lua

88 lines
1.9 KiB
Lua
Raw Normal View History

local awful = require("awful")
local wibox = require("wibox")
2024-02-19 19:41:33 -08:00
local widgets = require("ui.top-panel.widgets")
local beautiful = require("beautiful")
local vars = require("ui.top-panel.config")
local theme = beautiful.get()
local dpi = beautiful.xresources.apply_dpi
screen.connect_signal("request::desktop_decoration", function(s)
2024-02-19 19:41:33 -08:00
local clockdate = wibox.widget({
layout = wibox.layout.fixed.horizontal,
widgets.date,
widgets.clock,
2024-02-19 19:41:33 -08:00
})
2024-02-19 19:41:33 -08:00
local tasklist = wibox.widget({
{
layout = wibox.layout.fixed.horizontal,
s.tasklist, -- needs to be here (under the screen.connect_signal) bc of the s
},
forced_width = dpi(300),
2024-02-19 19:41:33 -08:00
layout = wibox.layout.fixed.horizontal,
})
2024-02-19 19:41:33 -08:00
-- Create the wibox
s.mywibox = awful.wibar({
position = "top",
screen = s,
margins = {
top = vars.margin,
right = vars.margin,
left = vars.margin,
},
border_width = theme.border_width,
border_color = theme.border_normal,
height = vars.height,
2024-02-19 19:41:33 -08:00
widget = {
layout = wibox.layout.align.horizontal,
expand = "none",
{
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
widgets.menu,
widgets.seperator,
2024-02-19 19:41:33 -08:00
s.taglist,
widgets.seperator,
2024-02-19 19:41:33 -08:00
tasklist,
},
left = theme.useless_gap,
2024-02-19 19:41:33 -08:00
right = 0,
top = vars.padding,
bottom = vars.padding,
2024-02-19 19:41:33 -08:00
layout = wibox.container.margin,
},
{
{
layout = wibox.layout.align.horizontal,
clockdate,
},
left = 0,
right = 0,
top = vars.padding,
bottom = vars.padding,
2024-02-19 19:41:33 -08:00
layout = wibox.container.margin,
},
{ -- Right widgets
{
layout = wibox.layout.fixed.horizontal,
widgets.systray,
widgets.seperator,
widgets.audio,
widgets.mem,
widgets.cpu,
widgets.disk,
widgets.layoutbox,
2024-02-19 19:41:33 -08:00
},
left = 0,
right = theme.useless_gap,
top = vars.padding,
bottom = vars.padding,
2024-02-19 19:41:33 -08:00
layout = wibox.container.margin,
},
},
})
end)