aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-06-17 19:52:48 +0200
committerTeddy Wing2019-06-17 19:52:48 +0200
commitaa2b320dd5af167d17423f2c26665e6316f7731e (patch)
treeb359204bea30b18ea24787ad90c277d9f3e75fb5
parent0237656b19a4dec0280b418b0183c95a0cab71e6 (diff)
downloadWindowMode.spoon-aa2b320dd5af167d17423f2c26665e6316f7731e.tar.bz2
Add shortcuts to move window by large increments
Takes the shortcuts of the previous medium increment bindings. Medium increments now use the Shift modifier, and small increments use Option.
-rw-r--r--window.lua42
1 files changed, 34 insertions, 8 deletions
diff --git a/window.lua b/window.lua
index d780877..8848275 100644
--- a/window.lua
+++ b/window.lua
@@ -25,6 +25,11 @@ local units = {
down_med = { x = 0, y = 20 },
left_med = { x = -20, y = 0 },
+ up_lg = { x = 0, y = -100 },
+ right_lg = { x = 100, y = 0 },
+ down_lg = { x = 0, y = 100 },
+ left_lg = { x = -100, y = 0 },
+
increase_right = { w = 5, h = 0 },
increase_down = { w = 0, h = 5 },
@@ -73,6 +78,22 @@ function window.left_med()
hs.window.focusedWindow():move(units.left_med, nil, false, 0)
end
+function window.up_lg()
+ hs.window.focusedWindow():move(units.up_lg, nil, false, 0)
+end
+
+function window.right_lg()
+ hs.window.focusedWindow():move(units.right_lg, nil, false, 0)
+end
+
+function window.down_lg()
+ hs.window.focusedWindow():move(units.down_lg, nil, false, 0)
+end
+
+function window.left_lg()
+ hs.window.focusedWindow():move(units.left_lg, nil, false, 0)
+end
+
function window.relative_size(window, relative_size)
local size = window:size()
@@ -145,15 +166,20 @@ function window:bindModal(modifiers, keycode)
window_mode:exit()
end)
- window_mode:bind({'shift'}, 'k', window.up_small, nil, window.up_small)
- window_mode:bind({'shift'}, 'l', window.right_small, nil, window.right_small)
- window_mode:bind({'shift'}, 'j', window.down_small, nil, window.down_small)
- window_mode:bind({'shift'}, 'h', window.left_small, nil, window.left_small)
+ window_mode:bind({'option'}, 'k', window.up_small, nil, window.up_small)
+ window_mode:bind({'option'}, 'l', window.right_small, nil, window.right_small)
+ window_mode:bind({'option'}, 'j', window.down_small, nil, window.down_small)
+ window_mode:bind({'option'}, 'h', window.left_small, nil, window.left_small)
+
+ window_mode:bind({'shift'}, 'k', window.up_med, nil, window.up_med)
+ window_mode:bind({'shift'}, 'l', window.right_med, nil, window.right_med)
+ window_mode:bind({'shift'}, 'j', window.down_med, nil, window.down_med)
+ window_mode:bind({'shift'}, 'h', window.left_med, nil, window.left_med)
- window_mode:bind({}, 'k', window.up_med, nil, window.up_med)
- window_mode:bind({}, 'l', window.right_med, nil, window.right_med)
- window_mode:bind({}, 'j', window.down_med, nil, window.down_med)
- window_mode:bind({}, 'h', window.left_med, nil, window.left_med)
+ window_mode:bind({}, 'k', window.up_lg, nil, window.up_lg)
+ window_mode:bind({}, 'l', window.right_lg, nil, window.right_lg)
+ window_mode:bind({}, 'j', window.down_lg, nil, window.down_lg)
+ window_mode:bind({}, 'h', window.left_lg, nil, window.left_lg)
window_mode:bind({}, 'i', window.move_to_top, nil, window.move_to_top)