Ubuntu – Run script full screen in terminal

14.04bashlubuntuscripts

How do I get a bash script to run in full screen when it's executed or how can I change the terminal size if I can't make it full screen?

Best Answer

"Fullscreen" isn't a bash concept at all, it's down to your terminal emulator window and X.

However if you're scripting, you can tell X to add a fullscreen hint to a client. I most applications this will work. I've tested with Terminator and I've no reason to suspect it won't work with Gnome Terminal:

# set fullscreen on startup
wmctrl -r :ACTIVE: -b add,fullscreen

# ... do your stuff ...

# and before you quit
wmctrl -r :ACTIVE: -b remove,fullscreen

With regard to keeping this at a minimum footprint, the only way I've found to do this is to launch another terminal. Unfortunately lxterminal doesn't have a fullscreen launch option so you could either hack through the OpenBox settings (beurgh) or just fall back to xterm:

xterm -fullscreen -hold -e ./anotherscript.sh

Yeah, I'm suggesting launching another terminal. If you're shipping this with a launcher of sorts, you can avoid needing a secondary script.

xterm doesn't adhere to standard fonts or anything like that though you can configure almost everything through command line arguments (see man xterm for a riveting read).