X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=hammerspoon%2Finit.lua;h=5beeeda2c10a28e7f2f87221f835d0e018409e99;hb=da1444b79dabf62580ab6acc7383ac0ee08857cd;hp=c795b627a067c5519b910c3d759ad8153a256aa7;hpb=1771976e7385e0a73318f0905e8172c1dd75d279;p=dotfiles.git diff --git a/hammerspoon/init.lua b/hammerspoon/init.lua index c795b62..5beeeda 100644 --- a/hammerspoon/init.lua +++ b/hammerspoon/init.lua @@ -85,15 +85,17 @@ function move_window(direction) f.w = max.w f.h = max.h / 2 elseif direction == "max" then - f.x = max.x - f.y = max.y - f.w = max.w - f.h = max.h - elseif direction == "center" then - f.x = max.x + (max.w / 6) - f.y = max.y + (max.h / 6) - f.w = max.w * 2 / 3 - f.h = max.h * 2 / 3 + if f.w > (max.w * 3/4) and f.h > (max.h * 3/4) then + f.x = max.x + (max.w / 6) + f.y = max.y + (max.h / 6) + f.w = max.w * 2 / 3 + f.h = max.h * 2 / 3 + else + f.x = max.x + f.y = max.y + f.w = max.w + f.h = max.h + end else hs.alert.show("move_window(): Freaky parameter received " .. direction) end @@ -108,7 +110,6 @@ hs.hotkey.bind(hyper, "l", move_window("right")) hs.hotkey.bind(hyper, "k", move_window("up")) hs.hotkey.bind(hyper, "j", move_window("down")) hs.hotkey.bind(hyper, "m", move_window("max")) -hs.hotkey.bind(hyper, "c", move_window("center")) -- Search and dictionary -- Past and copy