-   Linux - Newbie (
-   -   How do I pass command to gnome-terminal as an argument? (

crasywolf 08-02-2008 12:08 AM

How do I pass command to gnome-terminal as an argument?
I let my gnome-terminal automatically run at the start-up and now I want the window to be automatically maximized as well.

So I did some browsing online and found out about wmctrl.

It works fine when I type the following from the gnome-terminal:

wmctrl -r guest@localhost:~/Projects -b toggle,maximized_vert,maximized_horz
However, I am having a tough time on passing the above command to gnome-terminal as an argument.

gnome-terminal --working-directory=/home/guest/Projects --command wmctrl -r guest@localhost:~/Projects -b toggle,maximized_vert,maximized_horz &
I tried to wrap it with ' or " but did not work either.

Can anyone help me with this?

allez 08-02-2008 01:05 AM

Try to use -x (or --execute) instead of --command. But, AFAIR, when command passed to gnome-terminal as an argument exits, gnome-terminal closes itself.

smoked kipper 08-02-2008 12:52 PM

Surely the window manager has some way to maximize windows automatically?

Or just use the --geometry option.

crasywolf 08-02-2008 04:36 PM

smoked kipper: Can you tell me more about using window manager?

smoked kipper 08-02-2008 04:46 PM

I don't know what window manager you're using? I assume GNOME's (whatever it's called), so I'm afraid not, never used it, but presumably there must be some way to apply such options to a particular app.

cyber-monk 05-11-2010 10:00 AM

Sizing the gnome-terminal on startup
To size the gnome terminal use the following argument

The GEOMETRY argument is formated like this

Here are some examples

# specify size only
gnome-terminal --geometry=116x30

# specify size and position
gnome-terminal --geometry=116x30+200+200

# maximize the terminal
gnome-terminal --maximize

All times are GMT -5. The time now is 05:50 PM.