2

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 
3

The simplest way is to do

gnome-terminal --maximize

For some more powerful options, try DevilsPie.

  • 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 Mar 5 '13 at 22:29
  • 1
    It's listed under gnome-terminal --help-all. – Mikel Mar 5 '13 at 23:17
1

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
  • 1
    this requires wmctrl -r Terminal -b toggle,maximized_vert,maximized_horz. fullscreen causes to lose the title bar of the window. – rag Mar 11 '13 at 8:48
  • @rag: Right, fullscreen is fullscreen. – Emanuel Berg Mar 12 '13 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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