Also only show tag change visual feedback on the selected screen unless we are switching all of them

This commit is contained in:
Manu Cornet 2022-01-23 18:12:13 +00:00
parent c3bbc15ba4
commit c675f0e8be
1 changed files with 24 additions and 15 deletions

View File

@ -91,21 +91,30 @@ function workspace_grid:on_tag_selected(t)
-- This is the tag we are leaving -- This is the tag we are leaving
return return
end end
for i = 1, screen.count() do icon_path = "icons/workspace_" .. self.rows .. "x" .. self.columns .. "_" .. t.index .. ".svg"
s = screen[i] notification_config = {
icon_path = "icons/workspace_" .. self.rows .. "x" .. self.columns .. "_" .. t.index .. ".svg" icon = script_path() .. icon_path,
notification = naughty.notify({ icon_size = self.icon_size,
icon = script_path() .. icon_path, margin = 0,
icon_size = self.icon_size, position = self.position,
margin = 0, preset = naughty.config.presets.normal,
position = self.position, text = nil,
preset = naughty.config.presets.normal, timeout = 1,
replaces_id = s.workspace_notification_id, }
screen = i, if self.switch_all_screens then
text = nil, for i = 1, screen.count() do
timeout = 1, s = screen[i]
}) notification_config.screen = i
s.workspace_notification_id = notification.id notification_config.replaces_id = s.workspace_notification_id
notification = naughty.notify(notification_config)
s.workspace_notification_id = notification.id
end
else
focused_screen = awful.screen.focused()
notification_config.screen = focused_screen.index
notification_config.replaces_id = focused_screen.workspace_notification_id
notification = naughty.notify(notification_config)
focused_screen.workspace_notification_id = notification.id
end end
end end