Add initial spaces debug stuff

This commit is contained in:
2017-08-10 14:40:47 +01:00
parent 240d77cb82
commit 9d1c2f0bac

View File

@@ -2,6 +2,7 @@
local wm = { local wm = {
grid = require('ext.grid'), grid = require('ext.grid'),
spaces = require("hs._asm.undocumented.spaces"),
-- configuration -- configuration
animationDuration = 0.0, animationDuration = 0.0,
@@ -108,7 +109,7 @@ function wm:init ()
-- move to screen to the left -- move to screen to the left
bind({'cmd', 'ctrl'}, ',', bind({'cmd', 'ctrl'}, ',',
function() function ()
local win = hs.window.focusedWindow() local win = hs.window.focusedWindow()
win:moveOneScreenWest() win:moveOneScreenWest()
self.grid.snap(win) self.grid.snap(win)
@@ -117,7 +118,7 @@ function wm:init ()
-- move to screen to the right -- move to screen to the right
bind({'cmd', 'ctrl'}, '.', bind({'cmd', 'ctrl'}, '.',
function() function ()
local win = hs.window.focusedWindow() local win = hs.window.focusedWindow()
win:moveOneScreenEast() win:moveOneScreenEast()
self.grid.snap(win) self.grid.snap(win)
@@ -126,7 +127,7 @@ function wm:init ()
-- move to screen above -- move to screen above
bind({'cmd', 'ctrl'}, 'P', bind({'cmd', 'ctrl'}, 'P',
function() function ()
local win = hs.window.focusedWindow() local win = hs.window.focusedWindow()
win:moveOneScreenNorth() win:moveOneScreenNorth()
self.grid.snap(win) self.grid.snap(win)
@@ -135,12 +136,28 @@ function wm:init ()
-- move to screen bellow -- move to screen bellow
bind({'cmd', 'ctrl'}, 'N', bind({'cmd', 'ctrl'}, 'N',
function() function ()
local win = hs.window.focusedWindow() local win = hs.window.focusedWindow()
win:moveOneScreenSouth() win:moveOneScreenSouth()
self.grid.snap(win) self.grid.snap(win)
end end
) )
--
-- move between spaces
--
bind({'cmd', 'ctrl'}, 'up',
function ()
local inspect = require('inspect')
local win = hs.window.focusedWindow()
print(inspect(win:screen():id()))
print(inspect(self.spaces.layout()))
end
)
end end