luca-awesome-dotfiles/home/.config/awesome/signals/disk.lua
Hydroxycarbamide 2401cfcee2 Add revelation
Update and add bling task_preview, tag_preview and window_switcher
Add catppuccin-macchiato
Use my weather key
Update keybindings
Update autorun
Fix sliders
2023-03-20 09:51:48 +01:00

29 lines
546 B
Lua

-- ## Disk ##
-- ~~~~~~~~~~
-- requirements
-- ~~~~~~~~~~~~
local awful = require("awful")
local gears = require("gears")
local which_disk = "/dev/nvme0n1p5"
local function get_disk()
local script = [[
df -kH -B 1MB ]]..which_disk..[[ | tail -1 | awk '{printf $5}'
]]
awful.spawn.easy_async_with_shell(script, function(disk_perc)
disk_perc = disk_perc:match("%d+")
awesome.emit_signal("signal::disk", disk_perc)
end)
end
gears.timer {
timeout = 2000,
call_now = true,
autostart = true,
callback = function()
get_disk()
end
}