From c675f0e8bebf0414d48e8cfde772133dd22388e0 Mon Sep 17 00:00:00 2001 From: Manu Cornet Date: Sun, 23 Jan 2022 18:12:13 +0000 Subject: [PATCH] Also only show tag change visual feedback on the selected screen unless we are switching all of them --- awesome-workspace-grid.lua | 39 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/awesome-workspace-grid.lua b/awesome-workspace-grid.lua index 21f7289..2b14814 100644 --- a/awesome-workspace-grid.lua +++ b/awesome-workspace-grid.lua @@ -91,21 +91,30 @@ 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({ - 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, - }) - s.workspace_notification_id = notification.id + icon_path = "icons/workspace_" .. self.rows .. "x" .. self.columns .. "_" .. t.index .. ".svg" + notification_config = { + icon = script_path() .. icon_path, + icon_size = self.icon_size, + margin = 0, + position = self.position, + preset = naughty.config.presets.normal, + 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