#!/bin/bash

case "$1" in
    start)
       echo 'rpi-cli display openbox-started' | tee /etc/xdg/openbox/autostart
       xinit /usr/bin/openbox-session
    ;;
    restart)
        killall xinit
        xinit /usr/bin/openbox-session
    ;;
    stop)
        killall xinit
    ;;
    *)
        echo "Usage openbox.sh {start|restart|stop}"
        exit 1
    ;;
esac

exit 0
