6

For example, say I wanted to start gnome-terminal with it's northwest corner at 0,0, and make the window 736x434 pixels (apparently the default, which allows for an an 80-character by 24-character terminal window).

I'm not sure how much of this matters, but I'm using Ubuntu 11.04 with GNOME 3, and whatever versions of Xorg and the window manager (metacity? compiz?) come with that distro.

10

I don't know about gnome-terminal specifically, but you can place the standard xterm with a specific columns and rows size like this:

xterm -geometry 80x24+50+100

That's an 80 column, 24-line xterm, with the northwest corder at (50, 100). I believe X11 does it's coords in (x,y) where the upper left corner of the screen is (0,0) and coordinates get bigger to the right and down.

  • For gnome-terminal in my Ubuntu, it works with a leading double-dash, --geometry – Peter.O Oct 25 '11 at 17:42
3

If you want control for more than just the terminal's window, you can script general X GUI window placement etc, by using wmctrl and a few other X command line tools, but this startup position issue has been reasonably adressed by an app called devilspie .. It is in the Ubuntu repo.

This tool will find windows as they are created and perform actions
on them, such as resizing, moving to another workspace, or pinning
them to all workspaces.
  • 2
    Could you add usage examples? This would make this answer this much more useful. – Martin Scharrer Apr 21 '12 at 9:12
1

You can control any window with wmctrl. This script opens several mtr windows, name them uniquely and positions them on screen.


#!/bin/bash
OPTS='--gtk --interval=30'


function place_mtr
{
        host=$1
        name=mtr_$1
        xpos=$2
        ypos=$3
        xsize=$4
        ysize=$5

        mtr $OPTS $host &
        sleep 1
        wmctrl -r "My traceroute" -N "$name"
        wmctrl -r "$name" -e 0,$xpos,$ypos,$xsize,$ysize
}


place_mtr www.debian.org 0 0 710 150
place_mtr www.ubuntu.com 0 203 710 150
place_mtr www.kernel.org 0 390 710 150

place_mtr www.yahoo.com 770 0 710 150
place_mtr www.facebook.com 770 203 710 150
place_mtr www.google.com 770 390 710 150

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.