2024-02-19 19:41:33 -08:00
|
|
|
local wibox = require("wibox")
|
|
|
|
local beautiful = require("beautiful")
|
2024-02-18 14:31:14 -08:00
|
|
|
local dpi = beautiful.xresources.apply_dpi
|
2024-02-19 19:41:33 -08:00
|
|
|
|
2024-02-18 20:26:15 -08:00
|
|
|
-- Icon
|
2024-02-18 14:31:14 -08:00
|
|
|
local icon = wibox.widget.textbox()
|
2024-02-19 19:41:33 -08:00
|
|
|
icon.font = beautiful.font_name .. "12.5"
|
|
|
|
icon.align = "center"
|
|
|
|
icon.markup = "<span foreground='" .. beautiful.xcolor6 .. "'></span>"
|
2024-02-18 14:31:14 -08:00
|
|
|
|
2024-02-18 20:26:15 -08:00
|
|
|
-- Uptime
|
2024-02-18 14:31:14 -08:00
|
|
|
local mem = wibox.widget.textbox()
|
2024-02-19 19:41:33 -08:00
|
|
|
mem.font = beautiful.font_name .. "10"
|
|
|
|
mem.align = "center"
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
local function get_val()
|
|
|
|
awesome.connect_signal("signal::mem", function(mem_perc)
|
2024-02-19 19:41:33 -08:00
|
|
|
mem.markup = tonumber(mem_perc) .. "%"
|
|
|
|
end)
|
|
|
|
end
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
get_val()
|
|
|
|
|
2024-02-19 19:41:33 -08:00
|
|
|
local full = wibox.widget({
|
2024-02-18 14:31:14 -08:00
|
|
|
{
|
|
|
|
{
|
2024-02-19 19:41:33 -08:00
|
|
|
icon,
|
|
|
|
mem,
|
|
|
|
spacing = dpi(8),
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
2024-02-18 14:31:14 -08:00
|
|
|
},
|
2024-02-19 19:41:33 -08:00
|
|
|
left = 1,
|
|
|
|
right = 0,
|
|
|
|
layout = wibox.container.margin,
|
2024-02-18 14:31:14 -08:00
|
|
|
},
|
|
|
|
forced_width = 73,
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
2024-02-19 19:41:33 -08:00
|
|
|
})
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
return full
|