I use HammerSpoon with the ShiftIt spoon.
https://github.com/peterklijn/hammerspoon-shiftit
I like to move windows around with just my left hand, which doesn't work if you use the right command key.
Instead you can use left_alt + left_command together
The full list of commands I use with the ShiftIt spoon:
spoon.ShiftIt:bindHotkeys({
left = {{ 'alt', 'cmd' }, 'z' },
right = {{ 'alt', 'cmd' }, 'x' },
up = {{ 'alt', 'cmd' }, 'q' },
down = {{ 'alt', 'cmd' }, 'a' },
resizeIn = {{ 'alt', 'cmd' }, '-' },
resizeOut = {{ 'alt', 'cmd' }, '=' },
toggleZoom = {{ 'alt', 'cmd' }, 'f' },
upleft = {{ 'alt', 'cmd' }, '1' },
upright = {{ 'alt', 'cmd' }, '2' },
botleft = {{ 'alt', 'cmd' }, '3' },
botright = {{ 'alt', 'cmd' }, '4' }
})
Alt = Option on Mac
To move a window to the center of the screen with Hammerspoon:
hs.hotkey.bind({"cmd", "alt"}, "s", function()
-- size focused window to middle third of display
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = max.x + (max.w / 3)
f.y = max.y
f.w = max.w / 3
f.h = max.h
win:setFrame(f)
end)
To move a window to the next/previous screen (external display):
-- move window to next screen
-- bind hotkey
hs.hotkey.bind({'alt', 'ctrl', 'cmd'}, ']', function()
-- get the focused window
local win = hs.window.focusedWindow()
-- get the screen where the focused window is displayed, a.k.a. current screen
local screen = win:screen()
-- compute the unitRect of the focused window relative to the current screen
-- and move the window to the next screen setting the same unitRect
win:move(win:frame():toUnitRect(screen:frame()), screen:next(), true, 0)
end)
-- move window to previous screen
-- bind hotkey
hs.hotkey.bind({'alt', 'ctrl', 'cmd'}, '[', function()
-- get the focused window
local win = hs.window.focusedWindow()
-- get the screen where the focused window is displayed, a.k.a. current screen
local screen = win:screen()
-- compute the unitRect of the focused window relative to the current screen
-- and move the window to the previous screen setting the same unitRect
win:move(win:frame():toUnitRect(screen:frame()), screen:previous(), true, 0)
end)
I use left alt and left command together for one handed shortcuts.
I use Quicksilver to set triggers to open apps with left_alt + "key"
https://qsapp.com/