From 86e54ab4666e041db2d3b88714aba2dbf9356485 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 2 Dec 2020 14:26:32 +0100 Subject: pager: use focused attributes for focused screen --- pager.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'pager.lua') diff --git a/pager.lua b/pager.lua index 06a2760..d7acd83 100644 --- a/pager.lua +++ b/pager.lua @@ -103,10 +103,12 @@ function PagerDesk:new(desktop, screen, width, height) title_bar:add(title_desk, title_page) title_bar:set_ratio(1, 0.75) - local title_bg = beautiful.bg_focus or "#ffffff" - local title_fg = beautiful.fg_focus or "#000000" - local title_container = wibox.container.background(title_bar, title_bg) - title_container:set_fg(title_fg) + local title_normal_bg = beautiful.bg_normal or "#ffffff" + local title_normal_fg = beautiful.fg_normal or "#000000" + local title_focus_bg = beautiful.bg_focus or "#ff0000" + local title_focus_fg = beautiful.fg_focus or "#000000" + local title_container = wibox.container.background(title_bar, title_normal_bg) + title_container:set_fg(title_normal_fg) ret.widget = wibox.layout.fixed.vertical(title_container) @@ -127,6 +129,16 @@ function PagerDesk:new(desktop, screen, width, height) title_page:set_text(string.format("%d", page_idx)) end end) + client.connect_signal("focus", + function(c) + if c.screen == ret.screen then + title_container:set_fg(title_focus_fg) + title_container:set_bg(title_focus_bg) + else + title_container:set_fg(title_normal_fg) + title_container:set_bg(title_normal_bg) + end + end) ret.desktop = desktop ret.screen = screen -- cgit v1.2.3