Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to center window #6

Open
malob opened this issue May 30, 2018 · 3 comments
Open

Add ability to center window #6

malob opened this issue May 30, 2018 · 3 comments

Comments

@malob
Copy link

malob commented May 30, 2018

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.

@martisj
Copy link

martisj commented Jun 27, 2018

Won't hyper + f (fullscreen) do this for you ? If you push it a couple of times.

@malob
Copy link
Author

malob commented Jun 27, 2018

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.

@a7hybnj2
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants