diff options
author | Teddy Wing | 2023-11-08 19:55:23 +0100 |
---|---|---|
committer | Teddy Wing | 2023-11-08 19:55:23 +0100 |
commit | ebea1dc3c0b29ac5b4aa9f2f51cc70ff43191377 (patch) | |
tree | 39fff9ea31fe274fcb6cf10f570a13108782e9ea /window_layout.lua | |
parent | 8f600b057c85f63bf0dabe9287f58a1f130e45ee (diff) | |
download | dothammerspoon-ebea1dc3c0b29ac5b4aa9f2f51cc70ff43191377.tar.bz2 |
window_layout: Add debug log
After changing machines, I was having a problem with window layout
restoration. I had added this debug log, but then it magically started
working again. Committing this change anyway, maybe it actually did
something.
Diffstat (limited to 'window_layout.lua')
-rw-r--r-- | window_layout.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/window_layout.lua b/window_layout.lua index e32f37e..c97eb08 100644 --- a/window_layout.lua +++ b/window_layout.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2019 Teddy Wing +-- Copyright (c) 2019, 2022 Teddy Wing -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -13,17 +13,20 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <https://www.gnu.org/licenses/>. +window_layout_logger = hs.logger.new('window_layout', 'debug') + all_window_filter = hs.window.filter.new():setOverrideFilter({ visible = true }) window_positions = {} setmetatable(window_positions, {__index = function() return {} end}) -local function window_positions_save(window, _app_name, event_type) +function window_positions_save(window, _app_name, event_type) local screen = hs.screen.primaryScreen():id() if event_type == hs.window.filter.windowsChanged then window_positions[screen] = {} + window_layout_logger:d(hs.inspect(all_window_filter:getWindows())) for _, window in ipairs(all_window_filter:getWindows()) do window_positions[screen][window:id()] = window:frame() end |