3

I have a .xsession script. I am opening a gnome-terminal in background. I would like to open it maximised. I use Cinnamon as window manager. I do understand usually window manager is responsible for resizing client X applications when maximise button is clicked.

I want to know whether there is any way to achieve this.

~$ cat .xsession
google-chrome > /dev/null 2>&1 &
gnome-terminal &
gnome-session --session cinnamon 

2 Answers 2

3

The simplest way is to do

gnome-terminal --maximize

For some more powerful options, try DevilsPie.

2
  • 1
    --maximize was not documented in man pages of gnome-terminal. can you explain how this is option processed? Is it based on some screen information from X server?
    – rag
    Commented Mar 5, 2013 at 22:29
  • 1
    It's listed under gnome-terminal --help-all.
    – Mikel
    Commented Mar 5, 2013 at 23:17
2

In this particular case, if there is such an option, obviously, use it.

For other cases, I have found that the below code works.

The loop is there because if it weren't, the fullscreen command would fire off to soon, before there were such a window to put in fullscreen!

wmctrl -l is to list windows; wc -l is to count lines; wmctrl -r is to specify what window to operate on, and, with -b, you tell what to actually do to that window.

my-application &
while (( ! `wmctrl -l | my-application | wc -l` )) {}
wmctrl -r my-application -b toggle,fullscreen
2
  • 1
    this requires wmctrl -r Terminal -b toggle,maximized_vert,maximized_horz. fullscreen causes to lose the title bar of the window.
    – rag
    Commented Mar 11, 2013 at 8:48
  • @rag: Right, fullscreen is fullscreen. Commented Mar 12, 2013 at 2:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .