I have a simple widget to display free memory:
myFreeMemory = awful.widget.watch('bash -c "free -h | awk \'/^Mem:/ {print $3}\'"', 1)
This line produces a single number.
I would like to create a tooltip for it that runs a custom command:
local free_memory_tooltip = awful.tooltip
{
objects = { myFreeMemory },
timer_function = function()
return "free -h"
end,
font = "monaco 18",
timeout=0,
opacity=0.9,
bg="#000000",
fg="#ffffff",
align="top_left"
}
Instead of return "free -h"
, what should I put to execute this command and return the textual output?