mogenson/PaperWM.spoon

Configurable window widths

slarwise opened this issue · 3 comments

Thanks for an awesome window manager! Is it possible to make the window widths configurable? I use my 13 inch macbook pro and for me, the old window widths are more usable compared to the golden ratio ones introduces in #17.

Is it possible to make these configurable? Or perhaps even dynamic, depending on the screen size?

By old window widths, I mean these ratios:

{ 0.38195, 0.5, 0.61804 }.

Happy to do a PR if you're open to it

I think it's a great idea to make these window ratios configurable. They just need to be a module level variable like PaperWM.window_filter or PaperWM.window_gap.

If you'd like to submit a PR, I'd be happy to merge it.

Adding this here if someone is interested in using different window ratios for big and small screens. Adds a watcher that updates the ratios when the active screen changes.

hs.loadSpoon("PaperWM")
local function fitPaperWMRatiosToScreen(activeScreenChanged)
  if not activeScreenChanged then return end
  local screenWidth = hs.screen.mainScreen():frame().w
  if screenWidth >= 2000 then
    spoon.PaperWM.window_ratios = { 0.23607, 0.38195, 0.61804 }
  else
    spoon.PaperWM.window_ratios = { 0.38195, 0.5, 0.61804 }
  end
end
fitPaperWMRatiosToScreen(true) -- Run when hammerspoon starts to fit the active screen
Watcher = hs.screen.watcher.newWithActiveScreen(fitPaperWMRatiosToScreen):start()
spoon.PaperWM:start()