The selected answer didn't work for me on fully updated Ubuntu 12.04 LTS, so I decided it was time for a more drastic approach. The solutions below are tested up to 16.04 LTS.
My old solution
Rename original gnome-terminal
executable to
gnome-terminal-original
:
cd /usr/bin
sudo mv gnome-terminal gnome-terminal-original
Create a new file in /usr/bin
named gnome-terminal
with the
following content:
#!/bin/bash
/usr/bin/gnome-terminal-original --maximize $@
Make it executable:
sudo chmod +x gnome-terminal
Now no matter how I open the terminal, it always opens maximized. The only downside I see for this approach is that you have to repeat these steps every time you might update gnome-terminal
with a new version via update manager or apt-get upgrade
.
Note: the $@
parameter means that all arguments that might get passed to gnome-terminal
will still get passed to gnome-terminal-original
, along with --maximize
argument.
A better solution
Install "wmctrl":
sudo apt-get install wmctrl
Add this line to the very end of your ~/.bashrc
file:
wmctrl -i -r $WINDOWID -b add,maximized_vert,maximized_horz
Repeat the second step for other user's .bashrc
files if needed, for example, for "root" user (/root/.bashrc
).
This solution will not affect the size of the terminal window initially, but rather maximize it shortly after it opens, usually in a matter of milliseconds. You can try moving the line you added in the second step to the beginning of .bashrc
file, to make the terminal maximize even earlier.
I'm accepting this answer anyway :)
– tutuca Aug 05 '10 at 17:27.desktop
file on ubuntu 17.10+ – tutuca Mar 16 '18 at 22:09