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:


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

3 thoughts on “How to tweak default size and position of an application window in Ubuntu Unity”

  1. Whenever I break one terminal emulator (unsure if they’re officially emulators. Calm down nerds). Let me put it this way. When/if I have done enough damage to whichever gui of a terminal available to me on linux… I either first, if on Ubuntu. Ctrl+Alt+f5 (because 5 is my fav. You’re welcome to use a plethora of the f’s) you will be presented with nothing but a terminal directive. Full screen! Wish granted to the extreme muh vuggah!

    So, press those. Log in. If you remember where the .desktop launcher you thrashed is. Perf. Go to it, we’ll say you’re on Ubuntu and it’s not a snap or anything but the one you gnome’s there already (get it? Cause gnome almost sounds like the word I would have actually used in a real sentence. “Know”).

    $ cd ~/.local/share/applications/
    $ ls
    launcher1.desktop alotoflaunchers.desktop
    launcher2.desktop gnome-calculator.desktop
    gnome-terminal.desktop imsosilly.desktop

    $ vim (or nano these days if you’re not one of the go hards like I is)!
    $ nano gno (tab) gnome-calculator
    $ nano gnome-terminal.desktop

    See where you effed it. Edit it. Delete it. Have it launch a firefox with this site where you left off. Respond saying.. Oh I did something wrong.

    Or, open your software store and install any of the other terminals. Be it Xterm. xfce’s, Deepin probably has one even. KDE Kinks Keirs Kis Khe Koolest Kerminal Kever.

    Or whatever you want. There’s a fourth option (yeah I’m skipping the third) Show me the 5th solution and I won’t think you’re annoying.


Leave a Comment