aboutsummaryrefslogtreecommitdiff
path: root/mjolnir/init.lua
blob: d0084a4de13f2cf6c87d00a3813e34ef2113b6eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
local application = require "mjolnir.application"
local window = require "mjolnir.window"
local hotkey = require "mjolnir.hotkey"
local fnutils = require "mjolnir.fnutils"

hotkey.bind({"alt"}, "0", function()
    local win = window.focusedwindow()
    win:maximize()
end)

hotkey.bind({"alt"}, "left", function()
    local win = window.focusedwindow()
    if win ~= nil then
        win:movetounit({x=0, y=0, w=0.5, h=1})
    end
end)

hotkey.bind({"alt"}, "right", function()
    local win = window.focusedwindow()
    if win ~= nil then
        win:movetounit({x=0.5, y=0, w=0.5, h=1})
    end
end)

hotkey.bind({"alt"}, "down", function()
    local win = window.focusedwindow()
    if win ~= nil then
        win:movetounit({x=0.15, y=0, w=0.70, h=1})
    end
end)

hotkey.bind({"alt"}, "r", function()
    mjolnir:reload()
end)

hotkey.bind({"alt"}, "c", function()
    mjolnir.openconsole()
end)