Hammerspoon
https://scrapbox.io/files/633f707f09d6d30023ffde11.png
公式Docs
code:sh
brew install hammerspoon --cask
2022/11/1
画面分割
画面最大化
code:init.lua
hs.window.animationDuration = 0
units = {
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 },
bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 },
maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
}
mash = { 'ctrl', 'command' }
hs.hotkey.bind(mash, 'right', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
hs.hotkey.bind(mash, 'left', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
hs.hotkey.bind(mash, 'up', function() hs.window.focusedWindow():move(units.top50, nil, true) end)
hs.hotkey.bind(mash, 'down', function() hs.window.focusedWindow():move(units.bot50, nil, true) end)
mash = { 'option', 'ctrl', 'cmd' }
hs.hotkey.bind(mash, 'm', function() hs.window.focusedWindow():move(units.maximum, nil, true) end)
brew install hammerspoon --cask
maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
zipファイルを落とすだけ
2023/3/15
これがベスト
code:init.lua
hs.window.animationDuration = 0
units = {
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 },
bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 },
maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
}
mash = { 'ctrl', 'command' }
hs.hotkey.bind(mash, 'right', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
hs.hotkey.bind(mash, 'left', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
hs.hotkey.bind(mash, 'up', function() hs.window.focusedWindow():move(units.top50, nil, true) end)
hs.hotkey.bind(mash, 'down', function() hs.window.focusedWindow():move(units.bot50, nil, true) end)
mash = { 'option', 'ctrl', 'cmd' }
hs.hotkey.bind(mash, 'm', function() hs.window.focusedWindow():move(units.maximum, nil, true) end)
hs.hotkey.bind(mash, 'm', function() hs.window.focusedWindow():move(units.maximum, nil, true) end)
hs.hotkey.bind(mash, 'n', function() hs.window.focusedWindow():moveToScreen(hs.window.focusedWindow():screen():next(), false, true, 0) end)
hs.hotkey.bind(mash, 'p', function() hs.window.focusedWindow():moveToScreen(hs.window.focusedWindow():screen():previous(), false, true, 0) end)