blob: 263bc89694d53c152d4f7600a79353478ad85fa4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-- Do this when external monitor is connected
-- https://www.hammerspoon.org/docs/hs.screen.watcher.html
-- hs.screen.primaryScreen():name() == 'G247HL'
local function iterm2()
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
screen_watcher = hs.screen.watcher.new(function()
if hs.screen.primaryScreen():name() == 'G247HL' then
iterm2()
end
end)
screen_watcher:start()
|