miro-windows-manager
miro-windows-manager copied to clipboard
Add ability to center window
Thanks for making the spoon, it's so great.
Sometimes I have one window open on a large screen and it's nice to be able to center that window. I'd find it really convenient if there was an additional hotkey for this, e.g., center = {hyper, "c"}
. I'm imagining this would take the current window and move it to the center of the screen, preserving the dimensions and y position.
Won't hyper + f
(fullscreen) do this for you ? If you push it a couple of times.
That works for some cases, but there are a bunch of times where I want a window to just move to the center with it's current dimensions.
In my usual workflow I very often have two windows side by side on an external 27-inch monitor (I have the LG 5k display), each taking up half the screen. There are times where I close one of those windows and it would be nice to just center the other one and retain the full height. Examples include webpages or emails, generally content I want to read that doesn't always flow well when the window is made full screen.
Pressing hyper + f
multiple times doesn't do what I'd like since it reduces the height of the window. I tried pressing hyper + f
3 times then hyper + ↑ + ↓
, but that returns the window to full screen. Even if that worked though pressing 4 key combinations is getting a pretty cumbersome.
So in those cases I'd like to be able to just press something like hyper + c
to change the x position of the center of that window to be in the center of the screen. While not changing the y position, and not changing the dimensions of the window. I don't feel strongly that hyper + c
is the right solution. But I do think some quick/easy way to accomplish this would be a useful addition to this plugin.
Take a look at my init.lua should be commented well enough that you can copy the parts you want: https://github.com/a7hybnj2/dotfiles/blob/master/.hammerspoon/init.lua