summaryrefslogtreecommitdiff
path: root/pager.lua
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-12-02 14:26:32 +0100
committerAnton Khirnov <anton@khirnov.net>2020-12-02 14:26:32 +0100
commit86e54ab4666e041db2d3b88714aba2dbf9356485 (patch)
tree66463d8ca2103579a5aa572e28b831a28f5d5388 /pager.lua
parentad9ffe43945c708b20626ac487eec219eb25e301 (diff)
pager: use focused attributes for focused screen
Diffstat (limited to 'pager.lua')
-rw-r--r--pager.lua20
1 files changed, 16 insertions, 4 deletions
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