summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-06-11 08:03:33 +0200
committerAnton Khirnov <anton@khirnov.net>2021-06-11 08:03:33 +0200
commit1a3db44e1b3edf2f71f65ac072c884c3fdad0bbf (patch)
tree6910907504c8eb7b47b1e081c4f9bbff9697821a
parent4c9aac8f721f3bdfcc7eef565a47c20208c7ab3b (diff)
rc: scale systray icon size with DPI
-rw-r--r--rc.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/rc.lua b/rc.lua
index 97e98f6..359fd59 100644
--- a/rc.lua
+++ b/rc.lua
@@ -59,8 +59,16 @@ local clock_date = wibox.widget.textclock("<span size=\"11500\">%a %F</span>", 6
clock_time:set_align("center")
clock_date:set_align("center")
+-- systray
+local tray_icon_size = 24
local systray = wibox.widget.systray()
-systray:set_base_size(32)
+
+function update_systray_iconsize()
+ systray:set_base_size(beautiful.xresources.apply_dpi(tray_icon_size, screen.primary))
+end
+
+screen.connect_signal('primary_changed', update_systray_iconsize)
+update_systray_iconsize()
-- Create a wibox for each screen and add it
mywibox = {}