diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-11-16 16:09:18 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-11-16 16:09:18 +0100 |
commit | e2c6c45a2636b24b7efd1dacd2227689a0fe08c6 (patch) | |
tree | a7dd08523f710fa68860388bf25195d24d6fe63a /rc.lua | |
parent | 8aa3f747fc150b0fc2978effdd99f7daa7dd8cfd (diff) |
rc/workspace: handle screen removal cleanly
Diffstat (limited to 'rc.lua')
-rw-r--r-- | rc.lua | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -79,7 +79,7 @@ mypromptbox = {} local wsp = workspace.Workspace:new(layouts) awful.screen.connect_for_each_screen(function(s) - print('connected screen') + print('Setting up screen:') for k, v in pairs(s.outputs) do print(k) end @@ -126,6 +126,13 @@ awful.screen.connect_for_each_screen(function(s) mywibox[s] = awful.wibar({ position = "right", screen = s, width = panel_width }) mywibox[s]:set_widget(layout) + -- clean up on screen removal + s:connect_signal("removed", + function (s) + mywibox[s] = nil + mypromptbox[s] = nil + end) + -- show desktop <n> on <n>th screen gears.timer.delayed_call(function(s) wsp:view(s, s.index, 1) end, s) end) |