Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-02-2008, 12:08 AM   #1
LQ Newbie
Registered: Aug 2008
Posts: 2

Rep: Reputation: 0
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?
Old 08-02-2008, 01:05 AM   #2
Registered: Jul 2008
Location: Russia/Siberia/Krasnoyarsk
Distribution: SuSE, CentOS, FreeBSD
Posts: 77

Rep: Reputation: 21
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.

Last edited by allez; 08-02-2008 at 01:17 AM.
Old 08-02-2008, 12:52 PM   #3
smoked kipper
Registered: May 2008
Location: UK
Distribution: Slackware,Slamd64
Posts: 81

Rep: Reputation: 15
Surely the window manager has some way to maximize windows automatically?

Or just use the --geometry option.
Old 08-02-2008, 04:36 PM   #4
LQ Newbie
Registered: Aug 2008
Posts: 2

Original Poster
Rep: Reputation: 0
smoked kipper: Can you tell me more about using window manager?
Old 08-02-2008, 04:46 PM   #5
smoked kipper
Registered: May 2008
Location: UK
Distribution: Slackware,Slamd64
Posts: 81

Rep: Reputation: 15
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.
Old 05-11-2010, 10:00 AM   #6
LQ Newbie
Registered: Feb 2005
Location: Earth
Distribution: Ubuntu, Fedora
Posts: 4

Rep: Reputation: 0
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

Last edited by cyber-monk; 05-11-2010 at 10:03 AM.


geometry, gnome, gnometerminal, size, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resize the terminal window from the command line in the gnome terminal QuIcKSpArK Linux - Newbie 5 04-21-2012 03:04 PM
Howto pass an argument to alias of a script? Goose1 Programming 1 02-17-2008 07:14 PM
Pass argument between php scripts gandalf_the_grey Linux - Newbie 1 02-03-2006 03:53 PM
How to pass an argument to DHCPCD ? shazam75 Linux - Networking 3 02-27-2005 11:34 AM
PHP pass argument to shell script monzter Programming 2 08-14-2004 07:16 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration