diff options
-rw-r--r-- | init.lua | 1 | ||||
-rw-r--r-- | window_layout.lua | 17 |
2 files changed, 18 insertions, 0 deletions
@@ -22,6 +22,7 @@ require('gdrive_mouseover_item') require('mouse') require('terminal_tab_hotkeys') require('ufo') +require('window_layout') hs.loadSpoon('WindowMode') spoon.WindowMode:bindHotkeys({ mode = {{'ctrl', 'option'}, 'w'} }) diff --git a/window_layout.lua b/window_layout.lua new file mode 100644 index 0000000..1b6a8b1 --- /dev/null +++ b/window_layout.lua @@ -0,0 +1,17 @@ +-- Do this when external monitor is connected +-- 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)) +end + + +screen_watcher = hs.screen.watcher.new(function() + if hs.screen.primaryScreen():name() == 'G247HL' then + iterm2() + end +end) +screen_watcher:start() |