some improvements

This commit is contained in:
pmakhov 2017-12-14 21:05:43 -05:00
parent 4b533100a0
commit 3f007ecc76
1 changed files with 30 additions and 19 deletions

View File

@ -34,33 +34,44 @@ local w = wibox {
} }
w:setup { w:setup {
border_width = 0, {
colors = { border_width = 0,
'#74aeab', colors = {
'#6eaaa7', '#74aeab',
'#5ea19d', '#6eaaa7',
'#55918e', '#5ea19d',
'#4b817e', '#55918e',
'#4b817e',
},
display_labels = false,
forced_width = 25,
id = 'pie',
widget = wibox.widget.piechart
}, },
display_labels = false, {
forced_width = 25, text = 'Hello',
id = 'pie', widget = wibox.widget.textbox
widget = wibox.widget.piechart },
id = 'popup',
layout = wibox.layout.stack
} }
local function getPercentage(value)
return math.floor(value / total * 100 + 0.5) .. '%'
end
ramgraph_widget:buttons( ramgraph_widget:buttons(
awful.util.table.join( awful.util.table.join(
awful.button({}, 1, function() awful.button({}, 1, function()
awful.placement.top_right(w, { margins = {top = 25, right = 10}}) awful.placement.top_right(w, { margins = {top = 25, right = 10}})
w.pie.data_list = { w.popup.pie.data_list = {
{'used' , used}, {'used ' .. getPercentage(used), used},
{'free' , free}, {'free ' .. getPercentage(free), free},
{'shared' , shared}, -- {'shared ' .. getPercentage(shared), shared},
{'buff_cache' , buff_cache}, {'buff_cache ' .. getPercentage(buff_cache), buff_cache},
{'available' , available -- {'available ' .. getPercentage(available), available}
}
} }
w.pie.display_labels = true w.popup.pie.display_labels = true
w.visible = true w.visible = true
end), end),
awful.button({}, 3, function() awful.button({}, 3, function()