Live data from Hacker News

Hammerspoon

github.com

11–20 of 154 posts

Re: Hammerspoon

#11
post #3

here is my entire config hs.hotkey.bind({"ctrl"}, "D", function() hs.grid.show() end) i've tried all of the other fancy window managers and for me nothing has ever beat the ease of use of just (1) ctrl-d to see the grid, (2) type the letter where you want the top left corner of your window to be, (3) type the letter where you want the bottom right corner to be window resized

This is amazing! I have a slightly more elaborate setup that allows me to resize from one or another side, similar to what Apple added recently but with more flexibility, but this is super interesting, thanks for sharing!

Re: Hammerspoon

#13
I have fond memories of this app. However, after many years, I have moved on. I am in the process of writing my own replacement for some of the various use cases that Hammerspoon once provided me. Though, Hammerspoon will always be a source of great inspiration.

Re: Hammerspoon

#15
post #2

Has anyone worked on making a config replicating aerospace? Hammerspoon seems like a superset and it’s probably better to just have one, instead of two tools warring about who gets the keypresses?

What features are you trying to replicate from Aerospace?

Re: Hammerspoon

#17

I'd love to have a global "toggle Teams mute" button.

What do you mean? Like muting the entire application so no sound comes from Teams or muting yourself while on a call? For the latter, I thought 'Option + Space' worked (or used to)?

Re: Hammerspoon

#18
post #3

here is my entire config hs.hotkey.bind({"ctrl"}, "D", function() hs.grid.show() end) i've tried all of the other fancy window managers and for me nothing has ever beat the ease of use of just (1) ctrl-d to see the grid, (2) type the letter where you want the top left corner of your window to be, (3) type the letter where you want the bottom right corner to be window resized

Not that I insert EOFs very often, but does that conflict with CTRL+D in the terminal?

yeah the CTRL+D definitely gives me problems from time to time but thus far i have been too lazy to fix it

Re: Hammerspoon

#19
I fake a tiling window manager on Mac with Hammerspoon, resizing to fit in specific corners/sizes:

     -- resize based on ratios
    function ratioResize(xr, yr, wr, hr)
      return function ()
        local win = hs.window.focusedWindow()
        win:moveToUnit({x=xr,y=yr,w=wr,h=hr})
      end
    end

    -- 4 corners, different sizes
    hs.hotkey.bind({"cmd", "ctrl"}, "w", ratioResize(0,     0, 2/5, 2/3))
    hs.hotkey.bind({"cmd", "ctrl"}, "e", ratioResize(2/5,   0, 3/5, 2/3))
    hs.hotkey.bind({"cmd", "ctrl"}, "s", ratioResize(0,   2/3, 2/5, 1/3))
    hs.hotkey.bind({"cmd", "ctrl"}, "d", ratioResize(2/5, 2/3, 3/5, 1/3))
And to throw windows to other monitors:

    -- send to next screen
    hs.hotkey.bind({"cmd", "ctrl"}, ";", function()
      local win = hs.window.focusedWindow()
      local screen = win:screen()
      local next_screen = screen:next()

      win:moveToScreen(next_screen)
    end)
Post reply on HN