From dbd3334df48a568cd932e1ef6dd62dea102177d5 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 6 Jul 2019 19:03:07 +0200 Subject: window.lua: Add `c` shortcut to increase window height to bottom A single shortcut to extend the window to the bottom of the screen. --- window.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'window.lua') 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 -- cgit v1.2.3