How to tweak default size and position of an application window in Ubuntu Unity

Have you ever noticed that whenever an application is launched, its GUI window has a default size and position on your desktop? Ever felt the urge to tweak these values so that the window size and position suits your needs?

If that's what you are looking for, you've come to the right place, as in this tutorial, we will quickly describe how these details can be customized in Ubuntu. But before we do that, it's worth mentioning that all the instructions and commands (if any) mentioned in this tutorial have been tested on Ubuntu 14.04 with Unity version 7.2.5.

Customize size and position of an application window in Ubuntu

Here, we'll take the example of the gnome-terminal window. For example, on my machine, the following screenshot shows the default size and position of the terminal window:

Application Window position

Now, to change these default values, what you have to do is, open the .desktop file corresponding to the application - in this case /usr/share/applications/gnome-terminal.desktop.

vim /usr/share/applications/gnome-terminal.desktop

In my case, the file looks like this:

Gnome Terminal

Here, you'll have to modify the 'Exec' line (highlighted in the screenshot above). The information that's required to be added is the '--geometry' option followed by the new window width, height, and desktop position in the following format:

--geometry WIDTHxHEIGHT+XOFF+YOFF

For example, I added the following details (highlighted in bold) in my case:

Exec=gnome-terminal --geometry 130x24+500+400

Set new geometry

Once the change is done, save the .desktop file, close all instances of the application, and then again launch the app. You'll see that the window will now appear with the launch-time size and position provided by you.

For example, here's how the gnome-terminal window opened in my case:

Gnome terminal opened

Leave a Comment