Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Firefox full screen in minimalist X environment

I wish to set up what is usually called a Kiosk, running Firefox locked down to our own specific home page (and links from there). The base operating system is CentOs 5 (i.e. just like RedHat Enterprise 5).

Ideally I want Firefox to start full screen (and I have installed the full-fullscreen addon to help with this), and to be locked as such (i.e. F11 does not work).

I need to be able to install this system using one or more rpm files.

I have tested my fullscreen Firefox setup rpm under Gnome, and it works fine - my Gnome desktop is 1024x768, and the selected home page comes up exactly filling the screen - looks great.

However, I do not want to bother with a desktop environment (like Gnome or KDE), just run Firefox as the sole X client program, with a fixed screen size of 1024x768.

I have built rpms to install X, configure it to run at 1024x768, and fire up X automatically from an autologin using shell scripts.

My main autologon script contains this:

startx ~/client/xClient.sh  -- :1 &

xClient.sh contains this:

while [ true ]
do
    firefox
done

My problem is that Firefox does not come up full screen under this setup. The firefox window is smaller than the screen, and the top left corner is off the screen - this means the web page gets scrollbars, the top and left of the page does not show, and there is a black area along the bottom and right.

Does anyone know the reason for this behaviour?

What solutions can you suggest?

I suppose, if necessary, I could install Gnome on the machine, and then try to lock it down - but it seems silly to add something as complex as Gnome just to get the window to appear the right size, and in the right place! Plus there is the extra task of trying to lock Gnome down so the users can't do anything else with the machine.

If you think this question should not be on Stack Overflow, please tell me where it should go. (I think writing rpm and shell scripts are programming, but maybe they don't count? If not, sorry!)

like image 869
Nikki Locke Avatar asked Mar 06 '12 15:03

Nikki Locke


People also ask

How do I get Firefox to open in full screen mode?

Keyboard Shortcuts For those with a good memory. Go Full Screen via the keyboard. Toggle Full Screen keyboard shortcut: Press the F11 key. Note: On computers with a compact keyboard (such as netbooks and laptops), press the fn + F11 keys.

How do I make my browser full screen?

The fastest way to run Google Chrome in full-screen mode is to press the F11 key on your keyboard.

Is F11 full screen?

Fullscreen mode on a Windows computer To exit the standard view with the address bar, status bar, etc., always showing, press F11 on your keyboard to enter fullscreen.

How do I open Firefox in kiosk mode?

To run Firefox in Kiosk mode, you have to use the command line. To do so, run [install directory]\firefox.exe -kiosk.


3 Answers

You have 2 options. You install a kiosk plug-in, that allows you to start firefox automatically in full screen mode (amongst other things). One example would be R-kiosk

Or you skip firefox and create a xul application that does what you want. You can find a sample application here. And you can find full screen code (not tested) here.

like image 81
user1403360 Avatar answered Oct 11 '22 15:10

user1403360


We have a similar setup to yours and after a little testing decided to use a tiling window manager instead of just running chrome or firefox in X. A tiling window manager will give you fullscreen regardless of application and many will not have the windows borders/decorations, also great for kiosks.

Xmonad works really well for touch screens; matchbox works well too depending on your use case. Awesome and ratpoison are other good alternatives. You will probably have better luck picking a very minimalist window manager than running directly on X.

http://www.alandmoore.com/blog/2011/11/05/creating-a-kiosk-with-linux-and-x11-2011-edition/

Xmonad has tons of hotkeys which would have to be disabled, so while perfect for touchscreens, may not be suitable for kiosks with keyboards. It does have great configuration documentation and a vibrant community -- but is not a drop-kick solution with keyboard equipped kiosks.

like image 35
Bubnoff Avatar answered Oct 11 '22 14:10

Bubnoff


Maybe, it is worth looking at xdotool (it is not installed automatically, but present in Ubuntu repositories).

I hope something like

xdotool search --name ".*Mozilla Firefox" windowsize 1024 768

in your X startup script can help. Also you can adjust the window position and other window properties as needed.

like image 29
Dmytro Sirenko Avatar answered Oct 11 '22 15:10

Dmytro Sirenko