diff --git a/README.md b/README.md index e660a02..588301c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/awesome/src/widgets/systray.lua b/awesome/src/widgets/systray.lua index c9dfb86..a26953e 100644 --- a/awesome/src/widgets/systray.lua +++ b/awesome/src/widgets/systray.lua @@ -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