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

86 lines
1.7 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 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,
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 = dpi(5),
2024-02-19 19:41:33 -08:00
right = 0,
top = dpi(2),
bottom = dpi(2),
2024-02-19 19:41:33 -08:00
layout = wibox.container.margin,
},
{
{
layout = wibox.layout.align.horizontal,
clockdate,
},
left = 0,
right = 0,
top = dpi(1),
bottom = dpi(1),
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 = dpi(2),
top = dpi(1),
bottom = dpi(1),
2024-02-19 19:41:33 -08:00
layout = wibox.container.margin,
},
},
})
2024-02-19 19:41:33 -08:00
s.border2 = awful.wibar({
position = "top",
screen = s,
bg = theme.color.surface0,
2024-02-19 19:41:33 -08:00
height = dpi(2),
})
end)