Skip to content

Instantly share code, notes, and snippets.

@yoheioka
Created May 16, 2020 08:21
Show Gist options
  • Save yoheioka/ee20a61fd01aa55fc6dd1c5a8f543b04 to your computer and use it in GitHub Desktop.
Save yoheioka/ee20a61fd01aa55fc6dd1c5a8f543b04 to your computer and use it in GitHub Desktop.
Hacking the Caps Lock Key Part 2 monitors.lua
local hotkey = require 'hs.hotkey'
local window = require 'hs.window'
local geometry = require 'hs.geometry'
local mouse = require 'hs.mouse'
local screen = require 'hs.screen'
local position = import('utils/position')
local monitors = import('utils/monitors')
local function init_module()
for id, monitor in pairs(monitors.configured_monitors) do
hotkey.bind({ "cmd", "ctrl" }, "right", function()
local win = window.focusedWindow()
win:moveOneScreenEast()
end)
hotkey.bind({ "cmd", "ctrl" }, "left", function()
local win = window.focusedWindow()
win:moveOneScreenWest()
end)
end
end
return {
init = init_module
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment