commit
85fbddf6d9
|
@ -22,7 +22,7 @@ local function script_path()
|
||||||
end
|
end
|
||||||
|
|
||||||
local WIDGET_DIR = script_path()
|
local WIDGET_DIR = script_path()
|
||||||
local ICONS_DIR = WIDGET_DIR .. "/icons/"
|
local ICONS_DIR = WIDGET_DIR .. "icons/"
|
||||||
|
|
||||||
local LIST_PACKAGES = [[sh -c "LC_ALL=c apt list --upgradable 2>/dev/null"]]
|
local LIST_PACKAGES = [[sh -c "LC_ALL=c apt list --upgradable 2>/dev/null"]]
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ local LIST_PACKAGES = [[sh -c "LC_ALL=c apt list --upgradable 2>/dev/null"]]
|
||||||
local function show_warning(message)
|
local function show_warning(message)
|
||||||
naughty.notify({
|
naughty.notify({
|
||||||
preset = naughty.config.presets.critical,
|
preset = naughty.config.presets.critical,
|
||||||
title = "Docker Widget",
|
title = "APT Widget",
|
||||||
text = message,
|
text = message,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -54,9 +54,9 @@ local apt_widget = wibox.widget({
|
||||||
id = "icon",
|
id = "icon",
|
||||||
widget = wibox.widget.imagebox,
|
widget = wibox.widget.imagebox,
|
||||||
},
|
},
|
||||||
margins = 4,
|
layout = wibox.container.place,
|
||||||
layout = wibox.container.margin,
|
|
||||||
},
|
},
|
||||||
|
visible = true,
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
set_icon = function(self, new_icon)
|
set_icon = function(self, new_icon)
|
||||||
self:get_children_by_id("icon")[1].image = new_icon
|
self:get_children_by_id("icon")[1].image = new_icon
|
||||||
|
@ -352,14 +352,13 @@ local function worker(user_args)
|
||||||
end
|
end
|
||||||
end)))
|
end)))
|
||||||
|
|
||||||
|
|
||||||
wibox_popup:connect_signal("mouse::leave", function()
|
wibox_popup:connect_signal("mouse::leave", function()
|
||||||
if wibox_popup.visible then
|
if wibox_popup.visible then
|
||||||
wibox_popup.visible = false
|
wibox_popup.visible = false
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
return apt_widget_button
|
return apt_widget
|
||||||
end
|
end
|
||||||
|
|
||||||
return setmetatable(apt_widget, {
|
return setmetatable(apt_widget, {
|
||||||
|
|
Loading…
Reference in New Issue