Reworked a whole lot. New config file and theme config file for easier changes. Did #19. And much more

This commit is contained in:
Kievits Rene
2022-06-14 06:33:33 +02:00
parent fd74ab9fb4
commit 521d392769
60 changed files with 2216 additions and 1450 deletions

View File

@@ -4,12 +4,10 @@
-- Awesome Libs
local awful = require("awful")
local color = require("src.theme.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local watch = awful.widget.watch
local wibox = require("wibox")
require("src.core.signals")
local icon_dir = awful.util.getdir("config") .. "src/assets/icons/cpu/"
@@ -22,7 +20,9 @@ return function()
{
id = "icon",
widget = wibox.widget.imagebox,
image = gears.color.recolor_image(icon_dir .. "ram.svg", color["Grey900"]),
valign = "center",
halign = "center",
image = gears.color.recolor_image(icon_dir .. "ram.svg", Theme_config.ram_info.fg),
resize = false
},
id = "icon_layout",
@@ -47,15 +47,15 @@ return function()
right = dpi(8),
widget = wibox.container.margin
},
bg = color["Red200"],
fg = color["Grey900"],
bg = Theme_config.ram_info.bg,
fg = Theme_config.ram_info.fg,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
gears.shape.rounded_rect(cr, width, height, dpi(6))
end,
widget = wibox.container.background
}
Hover_signal(ram_widget, color["Red200"], color["Grey900"])
Hover_signal(ram_widget, Theme_config.ram_info.bg, Theme_config.ram_info.fg)
watch(
[[ bash -c "cat /proc/meminfo| grep Mem | awk '{print $2}'" ]],
@@ -64,7 +64,8 @@ return function()
local MemTotal, MemFree, MemAvailable = stdout:match("(%d+)\n(%d+)\n(%d+)\n")
local ram_string = tostring(string.format("%.1f", ((MemTotal - MemAvailable) / 1024 / 1024)) .. "/" .. string.format("%.1f", (MemTotal / 1024 / 1024)) .. "GB"):gsub(",", ".")
local ram_string = tostring(string.format("%.1f", ((MemTotal - MemAvailable) / 1024 / 1024)) ..
"/" .. string.format("%.1f", (MemTotal / 1024 / 1024)) .. "GB"):gsub(",", ".")
ram_widget.container.ram_layout.label.text = ram_string
awesome.emit_signal("update::ram_widget", math.floor(((MemTotal - MemAvailable) / MemTotal * 100) + 0.5))