I wanted to setup a monitor showing the status of the jobs in our Jenkins cluster to emphasise the importance of fixing broken builds within the team. This requires some screen to permanently display a web page configured using the Build Monitor Plugin view of a selection of the Jenkins jobs. As we have an old XP machine that has been retired it seemed like an ideal task for a lightweight Linux that boots straight into an X session that just runs a single web-browser task.

I selected lubuntu as a suitable distribution that does not require too much resources (we only have 256MB RAM on this PC). Lubuntu uses the LXDE desktop environment to keep resource usage low but uses the same base and package system as standard Ubuntu which we are already familiar with.

On startup the system defaults to launching lightdm as the X display manager. To configure a crafted session we create a new desktop file (kiosk.desktop) and add a new user account for the kiosk login. We do not need to know the password for this account as lightdm can be configured to autologin as this user by adding the following lines to the /etc/lightdm/lightdm.conf file:

# lines to include in /etc/lightmdm/lightdm.conf
# kiosk.desktop
[Desktop Entry]
Name=Kiosk Mode
Comment=Chromium Kiosk Mode
# kiosh.sh - session creation
/usr/bin/xset s off
/usr/bin/xset -dpms
/usr/bin/ratpoison &
/usr/bin/chromium-browser http://jenkins/view/Status/ --kiosk --incognito --start-maximized
/usr/bin/xset s on
/usr/bin/xset +dpms

These lines cause the system to automatically log the kiosk user account in and start the kiosk user session which will run the program defined in our kiosk.desktop file. For this all we now need to do is disable the screen-saver and monitor DPMS function and launch chromium to display the correct page. On the first attempt we found that the browser did not fill the screen and while this can be configured it was simpler to add the ratpoison tiling window manager to deal with this.

To avoid wasting power when no-one is around to view this display a cronjob was added to turn the monitor off at night and back on for the working day. The script used below either turns the monitor on and then disables DPMS or turns it off and re-enables the DPMS mode.

# Turn monitor permantly on or off.
DISPLAY=:0.0; export DISPLAY

function log()
    logger -p local0.notice -t DPMS $*

function dpms_force()
    xset dpms force $1 && log $1 || log FAILED to set $1

if [ $# != 1 ]
    echo >&2 "usage: dpms on|off|standby|suspend"
    exit 1

[ -r $COOKIE ] && xauth merge $COOKIE

case "$1" in
        # Turn on and disable the DPMS to keep it on.
        dpms_force on
        xset -dpms
        # Allow to turn off and leave DPMS enabled.
        dpms_force $1
        echo >&2 "invalid dpms mode \"$1\": must be on, off, standby or suspend"
        exit 1