externalize config for ram-widget

This commit is contained in:
streetturtle 2019-09-02 15:37:45 -04:00
parent 434cdae5e2
commit 54500cf15d
1 changed files with 80 additions and 68 deletions

View File

@ -2,8 +2,14 @@ local awful = require("awful")
local watch = require("awful.widget.watch")
local wibox = require("wibox")
local ramgraph_widget = {}
local function worker(args)
local args = args or {}
--- Main ram widget shown on wibar
local ramgraph_widget = wibox.widget {
ramgraph_widget = wibox.widget {
border_width = 0,
colors = {
'#74aeab', '#26403f'
@ -75,4 +81,10 @@ ramgraph_widget:buttons(
)
)
return ramgraph_widget
end
return setmetatable(ramgraph_widget, { __call = function(_, ...)
return worker(...)
end })