In recent Ubuntu releases including Ubuntu 20.04 and next Ubuntu 22.04, you may found that apps do not start at center of screen. They are either in top-left or the position you last time closed it.
For those who have Ubuntu PC with HiDPI display, it could be quite annoying that you have to move un-maximized app on every start before working on it.
NOTE: This tutorial is tested and works on Ubuntu 20.04 and Ubuntu 22.04 (daily iso), though it should work on all recent GNOME based Linux (e.g., Fedora, CentOS, Debian and Arch).
Option 1: Center App on Start via Gnome Tweaks:
System’s default ‘Settings‘ utility does not has the toggle option for this function, but the popular Gnome Tweaks tool does.
1. Firstly, search for and install the tool from Ubuntu Software if you don’t have it:
Ubuntu Software sucks. It does not work now and then in my case. Run the command below in terminal will also install the tool:
sudo apt update && sudo apt install gnome-tweaks
2. Then open ‘Gnome Tweaks’ and navigate to ‘Windows‘ from the left pane. Then find out and turn on the option for ‘Center New Windows‘ in the right.
That’s it!
Option 2: Single command to enable ‘Center New Windows’:
For those familiar with Linux commands, a single command can do the trick in Ubuntu and other Linux with GNOME.
Simply press Ctrl+Alt+T on keyboard to open terminal. Then, paste the command below and hit Enter:
gsettings set org.gnome.mutter center-new-windows true
The change will apply immediately after you hitting Enter to run the command.
That’s all. Enjoy!