aboutsummaryrefslogtreecommitdiffstats
path: root/window.lua
diff options
context:
space:
mode:
authorTeddy Wing2019-07-06 19:03:07 +0200
committerTeddy Wing2019-07-06 19:04:28 +0200
commitdbd3334df48a568cd932e1ef6dd62dea102177d5 (patch)
treefa17511977faae392400b1b9f217ea58c3fb46d4 /window.lua
parent8ad090ae8d4d77f25d49c092ffefb5c8d7444007 (diff)
downloadWindowMode.spoon-master.tar.bz2
window.lua: Add `c` shortcut to increase window height to bottomHEADmaster
A single shortcut to extend the window to the bottom of the screen.
Diffstat (limited to 'window.lua')
-rw-r--r--window.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/window.lua b/window.lua
index 955cbdb..7978ad1 100644
--- a/window.lua
+++ b/window.lua
@@ -48,6 +48,8 @@ local units = {
decrease_up_lg = { w = 0, h = -100 },
decrease_left_lg = { w = -100, h = 0 },
+ increase_down_maximum = { w = 0, h = 1.0 },
+
maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
}
@@ -181,6 +183,15 @@ function window.decrease_left_lg()
)
end
+function window.increase_down_maximum()
+ local duration = 0
+ local window = hs.window.focusedWindow()
+ local frame = window:frame()
+ frame.h = hs.screen.mainScreen():frame().h
+
+ window:setFrame(frame, duration)
+end
+
function window.move_to_top()
local position = hs.window.focusedWindow():topLeft()
@@ -230,6 +241,8 @@ function window:bindModal(modifiers, keycode)
window_mode:bind({}, 'd', window.increase_down_lg, nil, window.increase_down_lg)
window_mode:bind({}, 'f', window.increase_right_lg, nil, window.increase_right_lg)
window_mode:bind({}, 's', window.decrease_left_lg, nil, window.decrease_left_lg)
+
+ window_mode:bind({}, 'c', window.increase_down_maximum, nil, window.increase_down_maximum)
end
return window