diff options
Diffstat (limited to 'window_layout.lua')
-rw-r--r-- | window_layout.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/window_layout.lua b/window_layout.lua index 1b6a8b1..263bc89 100644 --- a/window_layout.lua +++ b/window_layout.lua @@ -2,10 +2,12 @@ -- https://www.hammerspoon.org/docs/hs.screen.watcher.html -- hs.screen.primaryScreen():name() == 'G247HL' local function iterm2() - -- TODO: Use `filter()` to get windows with title starting with "2. ". This - -- code grabbed window 3 once. - local win_2 = hs.application.find('com.googlecode.iterm2'):allWindows()[2] - win_2:setFrame(hs.geometry.rect(-1253.0,23.0,793.0,873.0)) + for _, window in ipairs(hs.application.find('com.googlecode.iterm2'):allWindows()) do + if window:title():match('^2%. ') then + window:setFrame(hs.geometry.rect(-1253.0,23.0,793.0,873.0)) + return + end + end end |