Last active
September 18, 2024 19:34
-
-
Save yrnehli/392f4eb234cc1d78fd61a31b1140a3bb to your computer and use it in GitHub Desktop.
Hammerspoon script to hide active window when middle clicking top left of window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hs.eventtap.new( | |
{ hs.eventtap.event.types.otherMouseDown }, | |
function(e) | |
local button = e:getProperty( | |
hs.eventtap.event.properties['mouseEventButtonNumber'] | |
) | |
if button == 2 then | |
m = hs.mouse.absolutePosition() | |
a = hs.application.frontmostApplication() | |
f = hs.window.focusedWindow():frame() | |
if m.y > f.y and m.y < f.y + 35 then | |
if m.x > f.x and m.x < f.x + 70 then | |
a:hide() | |
end | |
end | |
end | |
end | |
):start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment