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,22 +91,31 @@ function workspace_grid:on_tag_selected(t)
-- This is the tag we are leaving
return
end
for i = 1, screen.count() do
s = screen[i]
icon_path = "icons/workspace_" .. self.rows .. "x" .. self.columns .. "_" .. t.index .. ".svg"
notification = naughty.notify({
notification_config = {
icon = script_path() .. icon_path,
icon_size = self.icon_size,
margin = 0,
position = self.position,
preset = naughty.config.presets.normal,
replaces_id = s.workspace_notification_id,
screen = i,
text = nil,
timeout = 1,
})
}
if self.switch_all_screens then
for i = 1, screen.count() do
s = screen[i]
notification_config.screen = i
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
return setmetatable(workspace_grid, { __call = workspace_grid.new,})