diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2024-10-17 22:32:17 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2024-10-17 22:32:17 -0500 |
commit | df86f7b92a3d0985d6d8c9ab1d027eeddb7b0443 (patch) | |
tree | b5e27ebd0cea42abee2b3ef0981087cd2c3a57eb /awesome/widgets/ram.lua | |
parent | 572382a9ce99162bd93d2d6e3fd789f2c99bf420 (diff) | |
download | dotconfig-df86f7b92a3d0985d6d8c9ab1d027eeddb7b0443.tar.xz dotconfig-df86f7b92a3d0985d6d8c9ab1d027eeddb7b0443.zip |
remove awesome config, push to own repo
Diffstat (limited to 'awesome/widgets/ram.lua')
-rw-r--r-- | awesome/widgets/ram.lua | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/awesome/widgets/ram.lua b/awesome/widgets/ram.lua deleted file mode 100644 index 44ab314..0000000 --- a/awesome/widgets/ram.lua +++ /dev/null @@ -1,34 +0,0 @@ -local wibox = require("wibox") -local widgets = require("util.widgets") - - -function linux_ram_usage(widget) - -- read meminfo - local meminfof = io.open("/proc/meminfo") - - local total = meminfof:read():match("%d+") - local free = meminfof:read():match("%d+") - - meminfof:read() -- memavailable not used - - local buffers = meminfof:read():match("%d+") - local cached = meminfof:read():match("%d+") - - meminfof:close() - - -- calc - if total == nil then - return - end - - local used = (total - free - buffers - cached) * 100 / total - - widget:set_text(math.floor(used)) -end - --- return correct widget for os -if osname == "Linux" then - return widgets.watchfn(linux_ram_usage, 5) -end - -return wibox.widget.textbox("unsupported os") |