2024-02-18 20:26:15 -08:00
|
|
|
-- Standard awesome library --
|
2024-02-18 14:31:14 -08:00
|
|
|
local awful = require("awful")
|
2024-02-18 20:26:15 -08:00
|
|
|
local wibox = require("wibox")
|
2024-02-19 19:41:33 -08:00
|
|
|
local widgets = require("ui.top-panel.widgets")
|
2024-02-18 20:26:15 -08:00
|
|
|
local beautiful = require("beautiful")
|
|
|
|
|
2024-02-18 14:31:14 -08:00
|
|
|
local dpi = beautiful.xresources.apply_dpi
|
|
|
|
|
2024-02-18 20:26:15 -08:00
|
|
|
local clock = widgets.clock
|
|
|
|
local date = widgets.date
|
|
|
|
local cpu = widgets.cpu
|
|
|
|
local disk = widgets.disk
|
|
|
|
local keyboard = widgets.keyboard
|
|
|
|
local mem = widgets.mem
|
|
|
|
local menu = widgets.menu
|
|
|
|
local systray = widgets.systray
|
|
|
|
local audio = widgets.audio
|
|
|
|
local seperator = widgets.seperator
|
|
|
|
local layoutbox = widgets.layoutbox
|
|
|
|
|
|
|
|
local function create_icon(i, c) --Icon Creation
|
2024-02-19 19:41:33 -08:00
|
|
|
local widget = {
|
|
|
|
{
|
|
|
|
font = beautiful.font_name .. "12.5",
|
|
|
|
text = " " .. i,
|
|
|
|
widget = wibox.widget.textbox,
|
|
|
|
},
|
|
|
|
fg = c,
|
|
|
|
widget = wibox.container.background,
|
|
|
|
}
|
|
|
|
return widget
|
|
|
|
end
|
2024-02-18 14:31:14 -08:00
|
|
|
|
2024-02-18 20:26:15 -08:00
|
|
|
-- Create Icons with Color --
|
2024-02-19 19:41:33 -08:00
|
|
|
local calendar_icon = create_icon("", beautiful.xcolor5)
|
|
|
|
local clock_icon = create_icon("", beautiful.xcolor12)
|
|
|
|
local keyboard_icon = create_icon("", beautiful.xcolor4)
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
screen.connect_signal("request::desktop_decoration", function(s)
|
2024-02-19 19:41:33 -08:00
|
|
|
-- Create Clock with Colerfull Widget --
|
|
|
|
local clockdate = wibox.widget({
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
calendar_icon,
|
|
|
|
date,
|
|
|
|
clock_icon,
|
|
|
|
clock, -- Middle widget
|
|
|
|
})
|
2024-02-18 14:31:14 -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 = 300,
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
})
|
2024-02-18 14:31:14 -08:00
|
|
|
|
2024-02-19 19:41:33 -08:00
|
|
|
-- Create the wibox
|
|
|
|
s.mywibox = awful.wibar({
|
|
|
|
position = "top",
|
|
|
|
screen = s,
|
2024-02-18 14:31:14 -08:00
|
|
|
|
2024-02-19 19:41:33 -08:00
|
|
|
widget = {
|
|
|
|
layout = wibox.layout.align.horizontal,
|
|
|
|
expand = "none",
|
|
|
|
{
|
|
|
|
{ -- Left widgets
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
menu,
|
|
|
|
seperator,
|
|
|
|
s.taglist,
|
|
|
|
seperator,
|
|
|
|
tasklist,
|
|
|
|
},
|
|
|
|
left = 5, --Padding
|
|
|
|
right = 0,
|
|
|
|
top = 2,
|
|
|
|
bottom = 2,
|
|
|
|
layout = wibox.container.margin,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
layout = wibox.layout.align.horizontal,
|
|
|
|
clockdate,
|
|
|
|
},
|
|
|
|
left = 0,
|
|
|
|
right = 0,
|
|
|
|
top = 1,
|
|
|
|
bottom = 1,
|
|
|
|
layout = wibox.container.margin,
|
|
|
|
},
|
|
|
|
{ -- Right widgets
|
|
|
|
{
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
systray,
|
|
|
|
seperator,
|
|
|
|
audio,
|
|
|
|
mem,
|
|
|
|
cpu,
|
|
|
|
disk,
|
|
|
|
keyboard_icon,
|
|
|
|
keyboard,
|
|
|
|
layoutbox,
|
|
|
|
},
|
|
|
|
left = 0,
|
|
|
|
right = 2,
|
|
|
|
top = 1,
|
|
|
|
bottom = 1,
|
|
|
|
layout = wibox.container.margin,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
s.border2 = awful.wibar({
|
|
|
|
position = "top",
|
|
|
|
screen = s,
|
|
|
|
bg = beautiful.xcolorS0,
|
|
|
|
height = dpi(2),
|
|
|
|
})
|
|
|
|
end)
|
2024-02-18 14:31:14 -08:00
|
|
|
|