Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Environment: Red Hat Enterprise Linux, C language , Eclipse IDE for C/C++ Developers

Question: I'm programming a typing tutor which run on GNOME terminal, i want to maximize terminal when run the program(on GNOME). How can i realize it, does anyone have suggestions or any possible clues.

share|improve this question

migrated from Oct 28 '12 at 6:47

This question came from our site for professional and enthusiast programmers.

gnome-terminal --full-screen might help – Taylor Bioniks Oct 25 '12 at 16:14
$ gnome-terminal --maximize

Should do.

Take a look at

$ gnome-terminal --help
$ gnome-terminal --help-window-options

etc. to see what else you can do.

So you want to run your application inside a maximized GNOME terminal? The easiest way is to seperate launching the application from the code itself.

Write a shellscript wrapper which runs gnome-terminal --maximize -x my_typing_tutorial. Then set up the shortcut (or whatever) to run this script, instead of your binary.

Note this gives you a chance to detect if gnome-terminal isn't installed, and try starting konsole or xterm instead. It also means that a user can edit the start script if it doesn't work on their system, without having to re-compile your binary.

Note that I'm not addressing the question of how to maximize an existing terminal - if I were the user, I'd hate a program that messed up my window geometry without asking.

share|improve this answer
Thank for your graciously help. But seems like doesn't work, maybe i haven't described my problem clearly.As u may know, i'm using C language to program. What i expected is to maximum GNOME terminal when starting typing tutor(by pressing an START/OK button), not maximum terminal by Initialization. Which means if i can write some C language code to realize it, like by calling "system("clear)";" to clear terminal screen. Thank u again. – Takechiyocn Oct 25 '12 at 22:13
yeah, that's what i exactly wanted-the solutions & suggestions. u r right, i should consider about the protability and maximize my GNOME without user's permission is not a good idea, though the program is just a demo that my leader ask me to try. Thank you again. In the end, how can i change my text to a new line like u did... it's ugly without a proper new-line just as what i did... – Takechiyocn Oct 28 '12 at 9:45
If you mean the formatting, you have only limited control in comments. In questions and answers, just look at the help to see what you can do. – Useless Oct 28 '12 at 18:01

You can use wmctrl, to get current window id use $WINDOWID environment variable, to get current window geometry use xwinfo -id $WINDOWID

so after something like sudo aptitude install wmctrl :

  • wmctrl -i -r $WINDOWID -b toggle,fullscreen #toggle fullscreen
  • wmctrl -i -r $WINDOWID -b add,fullscreen #force fullscreen
  • wmctrl -i -r $WINDOWID -b remove,fullscreen #force remove fullscreen

Also wmctrl have own way to handle current window:

wmctrl -r :ACTIVE: -b toggle,fullscreen
share|improve this answer
well, thank u for ur help, i just tried as told, but seems nothing changed except "xwinfo -id $WINDOWID" shows my window information.Since i have installed wmctrl1.7, i don't know what happened though. – Takechiyocn Oct 28 '12 at 9:51
what you using gnome or kde ? in kde all works even for xterm my wmctrl version is 1.07 – zb' Oct 28 '12 at 10:24
eh, i'm using gnome, my vmctrl is also 1.07. but when tried : wmctrl -i -r $WINDOWID -b toggle,fullscreen - toggle fullscreen wmctrl -i -r $WINDOWID -b add,fullscreen - force fullscreen wmctrl -i -r $WINDOWID -b remove,fullscreen - force remove fullscree nothingh happened, i dont know why... – Takechiyocn Oct 28 '12 at 14:32
did you tried just wmctrl -i -r $WINDOWID -b toggle,fullscreen ? – zb' Oct 28 '12 at 17:24
On Ubuntu 13.10 in a gnome terminal this works perfectly. wmctrl -l shows the available windows. And e.g. wmctrl -i -r 0x05000682 -b toggle,fullscreen makes the window full screen. The :ACTIVE: handle does not work though. Ah, I see it DOES work, but then the -i flag has to be removed. – Anne van Rossum Feb 21 '14 at 9:26

You could create a launcher called it "Gnome Terminal Maximized" for your desktop and double-click on it. This is how to do it:

cat /usr/share/applications/gnome-terminal.desktop|sed 's/gnome-terminal/gnome-terminal --maximize/;s/Name=Terminal/& Maximized/' > ~/Desktop/gnome-terminal-maximized.desktop
share|improve this answer
thank u for the same. Actually i did't get u properly, well , i'm just a newbie about LINUX, people here are really enthusastic. Thk u all. – Takechiyocn Oct 28 '12 at 9:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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