You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.6 KiB
36 lines
1.6 KiB
-- This file is part of Reno desktop.
|
|
--
|
|
-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
--
|
|
-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
--
|
|
-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>.
|
|
-- Base for widgets
|
|
local awmtk2 = require("awmtk2")
|
|
local wibox = require("wibox")
|
|
|
|
return function(args)
|
|
local style = awmtk2.create_style("systray",
|
|
awmtk2.generic.status_widget,args.style,args.vertical)
|
|
local templates = awmtk2.create_template_lib("systray",awmtk2.templates,args.templates)
|
|
local t = awmtk2.build_templates(templates,style,args.vertical)
|
|
local widget = wibox.widget(t.center(t.container({
|
|
widget = wibox.widget.systray,
|
|
id = "systray"
|
|
})))
|
|
if args.vertical then
|
|
widget:get_children_by_id("systray")[1]:set_horizontal(false)
|
|
end
|
|
-- Stolen from the API. Apparently this function is entirely undocumented.
|
|
if awesome.systray() == 0 then
|
|
widget.visible = false
|
|
end
|
|
awesome.connect_signal("systray::update",function()
|
|
if awesome.systray() == 0 then
|
|
widget.visible = false
|
|
else
|
|
widget.visible = true
|
|
end
|
|
end)
|
|
return widget
|
|
end
|