2024-02-18 20:26:15 -08:00
|
|
|
local awful = require "awful"
|
|
|
|
local wibox = require "wibox"
|
|
|
|
local gears = require "gears"
|
|
|
|
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 helpers = require "helpers"
|
|
|
|
-- Icon
|
2024-02-18 14:31:14 -08:00
|
|
|
local icon = wibox.widget.textbox()
|
2024-02-18 20:26:15 -08:00
|
|
|
icon.font = beautiful.font_name.."12.5"
|
|
|
|
icon.align = 'center'
|
|
|
|
icon.markup = "<span foreground='"..beautiful.xcolor7.."'></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 disk = wibox.widget.textbox()
|
2024-02-18 20:26:15 -08:00
|
|
|
disk.font = beautiful.font_name.."10"
|
|
|
|
disk.align = 'center'
|
|
|
|
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
local function get_val()
|
|
|
|
awesome.connect_signal("signal::disk", function(disk_perc)
|
2024-02-18 20:26:15 -08:00
|
|
|
disk.markup = tonumber(disk_perc).. "%"
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
get_val()
|
|
|
|
|
2024-02-18 20:26:15 -08:00
|
|
|
|
|
|
|
local full = wibox.widget {
|
2024-02-18 14:31:14 -08:00
|
|
|
{
|
2024-02-18 20:26:15 -08:00
|
|
|
icon,
|
|
|
|
disk,
|
|
|
|
spacing = dpi(8),
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
2024-02-18 14:31:14 -08:00
|
|
|
},
|
|
|
|
left = 1,
|
2024-02-18 20:26:15 -08:00
|
|
|
right = 8,
|
|
|
|
layout = wibox.container.margin
|
|
|
|
}
|
|
|
|
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
return full
|
2024-02-18 20:26:15 -08:00
|
|
|
|