mirror of
https://github.com/streetturtle/awesome-wm-widgets.git
synced 2024-11-17 07:49:09 +01:00
some improvements
This commit is contained in:
parent
4b533100a0
commit
3f007ecc76
1 changed files with 30 additions and 19 deletions
|
@ -34,33 +34,44 @@ local w = wibox {
|
|||
}
|
||||
|
||||
w:setup {
|
||||
border_width = 0,
|
||||
colors = {
|
||||
'#74aeab',
|
||||
'#6eaaa7',
|
||||
'#5ea19d',
|
||||
'#55918e',
|
||||
'#4b817e',
|
||||
{
|
||||
border_width = 0,
|
||||
colors = {
|
||||
'#74aeab',
|
||||
'#6eaaa7',
|
||||
'#5ea19d',
|
||||
'#55918e',
|
||||
'#4b817e',
|
||||
},
|
||||
display_labels = false,
|
||||
forced_width = 25,
|
||||
id = 'pie',
|
||||
widget = wibox.widget.piechart
|
||||
},
|
||||
display_labels = false,
|
||||
forced_width = 25,
|
||||
id = 'pie',
|
||||
widget = wibox.widget.piechart
|
||||
{
|
||||
text = 'Hello',
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
id = 'popup',
|
||||
layout = wibox.layout.stack
|
||||
}
|
||||
|
||||
local function getPercentage(value)
|
||||
return math.floor(value / total * 100 + 0.5) .. '%'
|
||||
end
|
||||
|
||||
ramgraph_widget:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({}, 1, function()
|
||||
awful.placement.top_right(w, { margins = {top = 25, right = 10}})
|
||||
w.pie.data_list = {
|
||||
{'used' , used},
|
||||
{'free' , free},
|
||||
{'shared' , shared},
|
||||
{'buff_cache' , buff_cache},
|
||||
{'available' , available
|
||||
}
|
||||
w.popup.pie.data_list = {
|
||||
{'used ' .. getPercentage(used), used},
|
||||
{'free ' .. getPercentage(free), free},
|
||||
-- {'shared ' .. getPercentage(shared), shared},
|
||||
{'buff_cache ' .. getPercentage(buff_cache), buff_cache},
|
||||
-- {'available ' .. getPercentage(available), available}
|
||||
}
|
||||
w.pie.display_labels = true
|
||||
w.popup.pie.display_labels = true
|
||||
w.visible = true
|
||||
end),
|
||||
awful.button({}, 3, function()
|
||||
|
|
Loading…
Reference in a new issue