Ubuntu – How to open Chromium in full screen kiosk mode in minimal windows manager environment (like openbox / jwm)

14.04chromiumwindow-manager

I am trying to set up a simple Ubuntu kiosk box (14.04), running only a Chromium in a very minimal windows manager environment. Steps I've successfully done:

  • Login automatically: exec /bin/login -f kiosk_user < /dev/tty1 > /dev/tty1 2>&1 in /etc/init/tty1.conf
  • Start X environment (startx in .profile)
  • Start Chromium in X environment in .xinitrc
  • Start windows manager (tried fluxbox, jwm and openbox so far) in .xinitrc

What I currently have is Chromium starting properly but in semi-normal mode. I need to explitly press F11 from the keyboard to make Chromium to switch to the full screen and kiosk mode.

One fellow chromium user from a mailing list said that this would work fine in full GNOME environment without any tricks (even xdotool) – so this might be somehow related to these minimal windows managers.

I did even try to start Chromium itself without any windows manager (Chromium has something called Aura, its own WM for ChromiumOS?). In this mode, I could not get the Chromium to fill the whole screen. This method is not preferrable either as there is no possibility to open other applications easily for example for troubleshooting purposes.


.xinitrc

#!/bin/sh

rm ~/tmp/ -Rf
xset s off
xset dpms 600 60 60
xset +fp "$X_FONTPATH"
xset fp rehash

env > ~/.xenv

# Run chromium start
~/start_chromium.sh &

# Run window manager
exec openbox

start_chromium.sh

#!/bin/sh

set -e

CHROMIUM_TEMP=~/tmp/chromium
rm -Rf ~/.config/chromium/
rm -Rf $CHROMIUM_TEMP
mkdir -p $CHROMIUM_TEMP

chromium-browser \
    --disable \
    --disable-translate \
    --disable-infobars \
    --disable-suggestions-service \
    --disable-save-password-bubble \
    --disk-cache-dir=$CHROMIUM_TEMP/cache/ \
    --user-data-dir=$CHROMIUM_TEMP/user_data/ \
    --start-maximized \
    --kiosk "file:///home/kioskuser/kiosk.html" &
sleep 5
xdotool search --sync --onlyvisible --class "chromium" key F11

Best Answer

Close the browser and edit /home/user/.config/chromium/Default/Preferences. There will be a section in regards to window_placement.

For a resolution of 1920x1080 for example:

...

"window_placement": {
   "bottom": 1080,
   "left": 0,
   "maximized": true,
   "right": 1920,
   "top": 0,
   "work_area_bottom": 1080,
   "work_area_left": 0,
   "work_area_right": 1920,
   "work_area_top": 0
}

...

I could never find a way specify this at start-up and it can change if you open new browser windows.