Merge pull request #2 from TaPO4eg3D/main
Do not show the systray if there's no items in it
This commit is contained in:
@@ -70,4 +70,3 @@ Battery, Network (Wifi, Ethernet), Bluetooth, Volume, Keyboardlayout, Date (with
|
||||
- The Volume and Backlight keys will be really laggy when changed too fast
|
||||
- Not every program will use the Icon's pack icon in the taglist and tasklist
|
||||
- The Volume OSD wont go over 100% even if the volume is higher(the regular widget works)
|
||||
- The systay will stay even when empty since there is no way to check how many clients are in the systray
|
||||
|
||||
@@ -8,16 +8,14 @@ local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
require("src.core.signals")
|
||||
|
||||
|
||||
return function(s)
|
||||
|
||||
local systray = wibox.widget {
|
||||
{
|
||||
{
|
||||
wibox.widget.systray(),
|
||||
margins = dpi(6),
|
||||
widget = wibox.container.margin,
|
||||
id = 'st'
|
||||
},
|
||||
@@ -34,6 +32,16 @@ return function(s)
|
||||
-- Signals
|
||||
Hover_signal(systray.container, color["Red200"])
|
||||
|
||||
awesome.connect_signal("systray::update", function()
|
||||
local num_entries = awesome.systray()
|
||||
|
||||
if num_entries == 0 then
|
||||
systray.container.st:set_margins(0)
|
||||
else
|
||||
systray.container.st:set_margins(dpi(6))
|
||||
end
|
||||
end)
|
||||
|
||||
systray.container.st.widget:set_base_size(dpi(20))
|
||||
|
||||
return systray
|
||||
|
||||
Reference in New Issue
Block a user