Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am setting up Ubuntu with gnome for my grandma. How can I make firefox start ALWAYS maximized.

share|improve this question
3  
See the different answers of askubuntu.com/questions/27826/… –  N.N. Jul 18 '11 at 21:33
    
"class=Firefox" Disadvantage: you can't un-maximize it. . . . So the answer is to enter "class=Firefox", then open firefox, then close firefox, then remove the "class=Firefox". Now it will open up maximized, and you can un-maximize it any time you want. –  user166087 Jun 10 '13 at 15:56

2 Answers 2

It is possible to achieve this with a python script. The script requires python-wnck and python-gtk to be installed in order to work, although I think these are installed by default anyway.

Copy and paste this into a text editor and save it somewhere (eg ~/.maximised-firefox.py):

#!/usr/bin/env python
import wnck
import gtk
import subprocess
import time

firefox = subprocess.Popen(["firefox"])

b = True
while b:
    screen = wnck.screen_get_default()
    while gtk.events_pending():
        gtk.main_iteration()
    windows = screen.get_windows()
    for w in windows:
        if w.get_pid() == firefox.pid:
            w.maximize()
            b = False
    time.sleep(1)


firefox.wait()

Then make this executable and copy to a system wide location by opening a terminal and running:

chmod +x ~/.maximised-firefox.py
sudo cp ~/.maximised-firefox.py /usr/bin/maximised-firefox

You can then, using your grandma's profile, edit the menus using the menu editor. You can get to this from the right click menu of the menu or by running alacarte.

Then edit the firefox item and set the command to maximised-firefox.

menu editor

share|improve this answer
    
If you're not using the traditional menu (for example, if you're using the Unity Dash and Launcher), will you need to change the command for those Firefox launchers separately? –  michaelms Jul 18 '11 at 22:25
1  
No because the traditional menu, menu editor and the Unity dash all use gmenu as their backend. –  dv3500ea Jul 18 '11 at 22:53
    
Interesting solution, I had to sudo apt-get install python-wnck on Xubuntu 14.04 to get it to work. –  TuKsn Jul 2 at 14:26

Assuming you are using Compiz, you can force an application window to have certain characteristics (e.g. fullscreen, always maximized) by tweaking some settings:

  1. Install the CompizConfig Settings Manager Install CompizConfig

  2. Open it and go to the Window Rules section.

  3. In the Maximized text box, enter name=Navigator

  4. Finally, enable the Window Rules plugin (checkbox on the left).

screenshot of the Window Rules settings for Compiz

This will cause Firefox to always start maximized. As a potentially negative side effect, it will also make it impossible to un-maximize Firefox.

share|improve this answer
3  
class=Firefox also works. –  dv3500ea Jul 18 '11 at 22:14
    
@dv3500ea that's a lot more logical than name=Navigator, but I don't think I'll update my answer because I'm too lazy to take a new screenshot. :) –  michaelms Sep 14 '11 at 13:32

Your Answer

 
discard

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.