Skip to content

Instantly share code, notes, and snippets.

@peleteiro
Created October 7, 2015 13:48
Show Gist options
  • Save peleteiro/e00ae62c96b32d2b317b to your computer and use it in GitHub Desktop.
Save peleteiro/e00ae62c96b32d2b317b to your computer and use it in GitHub Desktop.
local application = require "mjolnir.application"
local hotkey = require "mjolnir.hotkey"
local window = require "mjolnir.window"
local screen = require "mjolnir.screen"
local fnutils = require "mjolnir.fnutils"
hotkey.bind({"cmd", "alt", "ctrl"}, "M", function()
local win = window.focusedwindow()
local screen = screen.mainscreen()
win:setframe(screen:fullframe())
end)
hotkey.bind({"cmd", "alt", "ctrl"}, "left", function()
local win = window.focusedwindow()
local screen = screen.mainscreen()
local frame = screen:fullframe()
frame.w = frame.w * 0.6
win:setframe(frame)
end)
hotkey.bind({"cmd", "alt", "ctrl"}, "right", function()
local win = window.focusedwindow()
local screen = screen.mainscreen()
local frame = screen:fullframe()
frame.x = frame.w - (frame.w * 0.4)
frame.w = frame.w * 0.4
win:setframe(frame)
end)
hotkey.bind({"cmd", "alt", "ctrl"}, "up", function()
local win = window.focusedwindow()
local screen = screen.mainscreen()
local frame = screen:fullframe()
frame.x = frame.w - (frame.w * 0.4)
frame.w = frame.w * 0.4
frame.h = frame.h * 0.7
win:setframe(frame)
end)
hotkey.bind({"cmd", "alt", "ctrl"}, "down", function()
local win = window.focusedwindow()
local screen = screen.mainscreen()
local frame = screen:fullframe()
frame.x = frame.w - (frame.w * 0.4)
frame.w = frame.w * 0.4
frame.y = frame.h - (frame.h * 0.3)
frame.h = frame.h * 0.3
win:setframe(frame)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment