How Do I Center Windows On Screen?

Asked by taurus

Everytime I open a window in Ubuntu 8.04, like terminal, it's not centered in the middle of my screen. How do I center it?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

You can paly with --geometry parameter then when you are happy you can store it as default launch command for your terminal from System->Preferences->Main Menu or into the Launcher icon if you have put a quick launch icon on your panels....

Example open a terminal and type or copy and paste:

gnome-terminal --geometry 100x32+5+24 &

gnome-terminal --geometry 100x32+115+224 &

Hope this helps

Revision history for this message
taurus (taurusxz) said :
#3

hi, again, marcobra. I don't understand your instructions. Will your instructions center some of my applications that load up to the corner of my screen? For example, when I open up terminal, it usually opens up to the left-hand corner of the screen. I want to center it in the middle of my screen.

.

Revision history for this message
Sam_ (and-sam) said :
#4

Hi taurus,
there are two specific options:
please open the configuration editor in applications menu -> system tools or type in a terminal:
gconf-editor

#1
navigate to:
/apps/metacity/general/focus_new_windows

setting: smart

#2
/apps/compiz/plugins/place/screen0/options/mode

Options are:
Algorithm to use for window placement (0 = Cascade, 1 = Centered, 2 = Smart, 3 = Maximize, 4 = Random)

setting: 1

works fine for me.

However compiz has of course a lot more options to play with window settings.

Enjoy Ubuntu

Revision history for this message
taurus (taurusxz) said :
#5

Hi, sam. I already have it in 'smart' setting. But windows keep opening up in the upper left hand side of the screen.

Revision history for this message
Andreas Troschka (signupbox) said :
#6

Set it to Centered (1) not to Smart (2) !!!

;-)

Revision history for this message
taurus (taurusxz) said :
#7

Hi andreas. I can't use your second method in setting it to 'Centered' in Compiz because I had uninstalled compiz-fusion from my computer. Anyway, I got it in 'smart' using your first method, but the apps don't center when they pop up. Do you know of another way?

Revision history for this message
Sam_ (and-sam) said :
#8

Hi again,
ok understood, no compiz, then let's talk about the option in metacity
#1
/apps/metacity/general/focus_new_windows
setting: smart

After choosing this option and opening for example 'gedit', it opens on the top left corner on the desktop, drag it to the middle of the desktop, close the window and reopen, where does it appear now?
Smart = enable learning so to speak. Should also work for other apps.

Revision history for this message
taurus (taurusxz) said :
#9

Hi, sam, thanks for getting back to me. I know what you're trying to say. But, this doesn't work with terminal. Terminal loads up in the upper left hand corner of the desktop. Your guess is as good as mine with terminal. Let me know though, bro!

Revision history for this message
Sam_ (and-sam) said :
#10

Hi,
since nothing helped, please try the manual solution which marcobra suggested in the first place.
It depends on the size of your monitor where the center is, that's why trial and error is suggested.

The default size of the Terminal window is around 80 columns wide and 24 columns high.
Example:
Lets say you have a starter from the terminal on the panel, then right click -> properties
Command: gnome-terminal --geometry=80x24+115+224
Close and open the terminal.

You can even use two profiles e.g. default and taurus.
Lets say the default starter is in the main menu applications->accessories->terminal without changes of size.
The command is only: gnome-terminal
The second profile is on the panel with changes of geometry, command is user specific and opening the two different profiles looks like this,
http://launchpadlibrarian.net/16873780/Terminal_profile.jpg

In addition:
https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/32787

Hope this helps.

Revision history for this message
taurus (taurusxz) said :
#11

Hi, sam and marcobra. OK, the terminal window does center to the middle of the screen, but ONLY if other appslications aren't on screen. For example, when I got Opera maximized on the screen, terminal loads up in the upper left hand corner of the screen. If I minimize Opera and any other application on the screen where only the Desktop is visible, terminal loads up dead center of the screen. Weird, but true.

Revision history for this message
Sam_ (and-sam) said :
#12

Hi,
well, Metacity is a rather simple window manager, not stuffed with lots of details and since you don't use compiz one alternative is add to wishlist.

http://www.plig.org/xwinman/

Can you help with this problem?

Provide an answer of your own, or ask taurus for more information if necessary.

To post a message you must log in.