From fc75b89a0db3ecee2d59bcff7eab815dba796509 Mon Sep 17 00:00:00 2001 From: josiah Date: Sun, 10 Apr 2022 16:07:37 -0500 Subject: [PATCH] Add fix for idiot new awesomewm behavior. Reference: https://www.reddit.com/r/awesomewm/comments/5r9mgu/client_layout_not_preserved_when_switching/ What a dumb goddamn problem. Super glad the workaround is copy-pastable. --- .config/awesome/rc.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 0eb26bd..5e4a65c 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -624,3 +624,22 @@ if autorun then awful.util.spawn(autorunApps[app]) end end + + +tag.connect_signal("request::screen", function(t) + for s in screen do + if s ~= t.screen and + s.geometry.x == t.screen.geometry.x and + s.geometry.y == t.screen.geometry.y and + s.geometry.width == t.screen.geometry.width and + s.geometry.height == t.screen.geometry.height then + local t2 = awful.tag.find_by_name(s, t.name) + if t2 then + t:swap(t2) + else + t.screen = s + end + return + end + end +end)