Add multimonitor support
This commit is contained in:
parent
9420483d5c
commit
6b694cda51
1 changed files with 18 additions and 1 deletions
|
|
@ -17,13 +17,25 @@ local topright = {x=1,y=0,w=1,h=1}
|
||||||
local bottomleft = {x=0,y=1,w=1,h=1}
|
local bottomleft = {x=0,y=1,w=1,h=1}
|
||||||
local bottomright = {x=1,y=1,w=1,h=1}
|
local bottomright = {x=1,y=1,w=1,h=1}
|
||||||
local full = {x=0,y=0,w=2,h=2}
|
local full = {x=0,y=0,w=2,h=2}
|
||||||
|
local first = hs.screen.allScreens()[3]
|
||||||
|
local second = hs.screen.allScreens()[2]
|
||||||
|
local third = hs.screen.allScreens()[1]
|
||||||
|
|
||||||
function sendTo(area)
|
function sendTo(area)
|
||||||
local win = hs.window.focusedWindow()
|
local win = hs.window.focusedWindow()
|
||||||
local screen = hs.screen.mainScreen()
|
local screen = win:screen()
|
||||||
hs.grid.set(win,area,screen)
|
hs.grid.set(win,area,screen)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function selectWindow()
|
||||||
|
hs.hints.windowHints()
|
||||||
|
end
|
||||||
|
|
||||||
|
function moveToScreen(screen)
|
||||||
|
local win = hs.window.focusedWindow()
|
||||||
|
win:moveToScreen(screen,0)
|
||||||
|
end
|
||||||
|
|
||||||
k:bind({}, 'escape', function() k:exit() end)
|
k:bind({}, 'escape', function() k:exit() end)
|
||||||
k:bind({}, 'h', function() sendTo(left) end)
|
k:bind({}, 'h', function() sendTo(left) end)
|
||||||
k:bind({}, 'j', function() sendTo(bottom) end)
|
k:bind({}, 'j', function() sendTo(bottom) end)
|
||||||
|
|
@ -35,6 +47,11 @@ k:bind({}, 'b', function() sendTo(bottomleft) end)
|
||||||
k:bind({}, 'n', function() sendTo(bottomright) end)
|
k:bind({}, 'n', function() sendTo(bottomright) end)
|
||||||
k:bind({}, 'f', function() sendTo(full) end)
|
k:bind({}, 'f', function() sendTo(full) end)
|
||||||
|
|
||||||
|
hs.hotkey.bind({"cmd","ctrl"}, 'f', function() selectWindow() end)
|
||||||
|
k:bind({"shift"}, 'a', function() moveToScreen(first) end)
|
||||||
|
k:bind({"shift"}, 'o', function() moveToScreen(second) end)
|
||||||
|
k:bind({"shift"}, 'e', function() moveToScreen(third) end)
|
||||||
|
|
||||||
function reload_config(files)
|
function reload_config(files)
|
||||||
hs.reload()
|
hs.reload()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue