awesome : inutile d'ajouter le tooltip en boucle
This commit is contained in:
@@ -230,7 +230,7 @@ local iostat_tooltiptext = ""
|
|||||||
-- Widget de monitoring de l'activité des disques https://awesomewm.org/recipes/watch/
|
-- Widget de monitoring de l'activité des disques https://awesomewm.org/recipes/watch/
|
||||||
-- disk I/O using iostat from sysstat utilities
|
-- disk I/O using iostat from sysstat utilities
|
||||||
local iotable = {}
|
local iotable = {}
|
||||||
local iostat = awful.widget.watch("iostat -dm -y -z 1 1", 2, -- in Kb, use -dm for Mb
|
local iostat = awful.widget.watch("iostat -dm -y 1 1", 2, -- in Kb, use -dm for Mb
|
||||||
function(widget, stdout)
|
function(widget, stdout)
|
||||||
for line in stdout:match("(sd.*)\n"):gmatch("(.-)\n") do
|
for line in stdout:match("(sd.*)\n"):gmatch("(.-)\n") do
|
||||||
local device, tps, read_s, wrtn_s, read, wrtn =
|
local device, tps, read_s, wrtn_s, read, wrtn =
|
||||||
@@ -248,18 +248,18 @@ local iostat = awful.widget.watch("iostat -dm -y -z 1 1", 2, -- in Kb, use -dm f
|
|||||||
-- customize here
|
-- customize here
|
||||||
--widget:set_text("sda: "..iotable["sda"][2].."/"..iotable["sda"][3]) -- read_s/wrtn_s
|
--widget:set_text("sda: "..iotable["sda"][2].."/"..iotable["sda"][3]) -- read_s/wrtn_s
|
||||||
widget:set_text("iostat")
|
widget:set_text("iostat")
|
||||||
|
|
||||||
widget_t = awful.tooltip({
|
|
||||||
--objects = { },
|
|
||||||
timer_function = function()
|
|
||||||
return iostat_tooltiptext
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
widget_t:add_to_object(widget)
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
iostat_t = awful.tooltip({
|
||||||
|
--objects = { },
|
||||||
|
timer_function = function()
|
||||||
|
return iostat_tooltiptext
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
iostat_t:add_to_object(iostat)
|
||||||
|
|
||||||
-- tris d'un tableau par la clef https://stackoverflow.com/questions/15706270/sort-a-table-in-lua
|
-- tris d'un tableau par la clef https://stackoverflow.com/questions/15706270/sort-a-table-in-lua
|
||||||
function spairs(t, order)
|
function spairs(t, order)
|
||||||
-- collect the keys
|
-- collect the keys
|
||||||
|
|||||||
Reference in New Issue
Block a user