Is there a way to center the active window? I can't seem to find a keyboard shortcut that does this!

Greetings,

I have looked in the settings but I can’t find a setting where I can center the active window with a shortcut or to open new windows centered. Is there a way to do this?

Thanks in advance!

Centered, but any requirements to size?

No, I just want a quick way to center my windows that I open or that I resize. I just converted from Windows to Linux and on Windows I had made a script that always checks if the active window is in the center, and if it is not, then center it.

I looked everywhere on the internet but I can’t find anything about a tool or scripting language that can do the same on Linux.

Best case for me would be a program that always checks if a Window is in the center, and if it is not, center it.

On Windows I also had exceptions like, don’t center when it is maximized, or when I press and hold the left mouse button etc.

But, until I find a equal for Linux, a shortcut keyboard command or something else that allows me to center windows, would be most helpful.

The reason I want this because I like things neatly centered. Calms my mind so to speak!

We have the window shuffler (press Super +s) https://www.youtube.com/watch?v=Ii4n8H4XEzc which is available by default. The addition shuffler_nogui is not installed by default, but you can simply download it https://github.com/UbuntuBudgie/window-shuffler. Run it from a keyboard shortcut like 3 3 1 1 to place the active window centered in a 3x3 matrix. Let me know if you manage, on the phone currently, but I can guide you through if I am home.

I did discover that GUI option. This is handy in the meantime, but so far, if I use it to center one window, it also resizes the window to the size of the grid.

I just want my window to be in the middle of the screen, with whatever size that window currently is.

Is that also a possibility or did I misunderstood your earlier question?

Ah, I see, you’d like it to keep sized as it is, but centered?

Yes, exactly! If it can be done automatically even better.

Ah, I see. I’ll see if I can fix something, throw it in experimental.

1 Like

You would help me out so much if you could. I would do it myself if I could but I am rather new to Linux and when I finally made a script myself on the Windows side with AutoHotkey, it was both awesome and a bit sad since that centering was a reason for me to stick with Windows.

I know it can be done with Linux but so far no luck with googling. And what I did found was either old or it didn’t work.

So, with the Steam Play happenings, I decided to go back to Linux and hopefully permant this time. All I need now is this one little OCD thing of mine fixed and I can rest easy.

Thanks for taking the time reading my posts. And my compliments on the distro. When I saw someone mention it on Reddit I had to take a look since I never heard of this Ubuntu version before. Was sold straight away with the sexy looks of the UI.

Also well done on the welcome screen! Helped me set up a few things straight away. Love that you included Vivaldi in there aswel!

You could wrap one of those answers to centre the active window via a keyboard shortcut

I think the mutter answer here should enable new Windows to open centred I.e. not the accepted answer since that is for the Unity desktop

Thanks for the suggestions. I found both by Google in the past. The first one I even tried but I could not get the command to do anything.

The other, as you said, isn’t applicable anymore with the latest Ubuntu.

I hope vlijm can whip something up.

What is this experimental btw? Is that something we can access as well if we wanted to have something newer?

In experimental, we push all kinds of -experimental- stuff. Some of it is kind of ready to use, like the one I mentioned, the “headless” window switcher and the wallpaper switcher/timer, other stuff is purely for ourselves to, well, do some experimenting preparations for development. We’d probably need to create a repo of good, working stuff, not really fit for the regular Ubuntu Budgie release, nevertheless very useful for a limited number of users.

Cooked something: https://github.com/UbuntuBudgie/experimental/tree/master/center_all. Setting up is described in the README, but please let me know if you need any help setting it up.

1 Like

First off, thanks for taking the time doing this. I just tested it. The instructions where perfect.

So far, when I have the windows on my left monitor, which is number 2, the centering works. When I have the windows on my main monitor, number 1, then the script seems the center the windows in the middle of where my monitor ends and the other begins. I can make a screenshot to show what I mean.

I think something isn’t going right because of my multi-monitor setup. I have 3 monitors.

Still, you did for me what I could not, and nothing on the internet was helpful. If it can work accross monitors perfectly I am golden!

Any chance you have hdpi? Screenshot would be extremely useful!

I will make a screenshot now. Everything is at 100%, no dpi scaling and the likes.

My left vertical monitor is 1080x1920, the middle is 1920x1080 and the third on the right is my 4K TV.

But only the first 2 are used, the TV only when I watch a movie.

But it is connected?

As you can see, where the monitor goes over to the other, is where it centers if those windows are on my main monitor.

20180825_213747