Ubuntu – the most basic window manager for ubuntu that can be used to display a single application

12.04window-managerxorg

I've tried starting a full screen application without a window manager, using xinit,
which works but instead of starting at the top left of the screen the application starts somewhere in the middle of my screen.

I've tried the same using a custom entry in /usr/share/xsessions
and starting that from lightdm instead
of the default ubuntu window manager, but that gives me the same result.

I've then added my application to the startup applications of the ubuntu window manager
and that works properly… but I don't want to start the entire desktop

So I'm thinking perhaps a simple window manager will allow me to define that my application
should start as soon as it is loaded and that as a result it will be displayed full screen
and starting at the upper left corner of the screen.

So basically a Window Manager that will allow me to disable everything except my application. (And the background should be completely black by default so that the screen is black until my application has finished loading

Best Answer

The ratpoison window manager is what you want.

  1. Install ratpoison

    sudo apt-get install ratpoison
    
  2. Create a user and have that user automatically log in.

  3. Create a desktop file in /usr/share/xsessions/kiosk.desktop

    [Desktop Entry]
    Encoding=UTF-8
    Name=Browser Mode
    Comment=Kiosk desk Session
    Exec=/usr/share/xsessions/run_kiosk.sh
    Type=Application`
    
  4. Create /usr/share/xsessions/run_kiosk.sh. Modify the following to get you started

    #!/bin/bash
    /usr/bin/ratpoison &
    
    TERMINAL=`who | awk '{print $2}'`
    
    if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
            eval 'dbus-launch --sh-syntax --exit-with-session'
    fi
    
    rm -Rf ~/.config/google-chrome
    dbus-launch /usr/bin/google-chrome --no-default-browser-check
    rm -Rf ~/.config/google-chrome
    
    kill `ps | grep dbus-launch | grep -v grep | awk '{print $1}'`
    
  5. This resets Chrome on every launch. Use the default preferences in /opt/google/chrome/master_preferences to set up Chrome how you want it.

  6. Set the default desktop as kiosk:

    sudo /usr/lib/lightdm/lightdm-set-defaults -s kiosk