#!/bin/sh
#
# Start SliTaz Tiny/Touch Screens desktop session
#

export STS_DESKTOP_WM="openbox"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"

data="/usr/share/slitaz/sts"
obconf="${XDG_CONFIG_HOME}/openbox"

# Ob sts-rc.xml
if [ ! -f "${XDG_CONFIG_HOME}/openbox/sts-rc.xml" ]; then
	mkdir -p ${obconf}
	cp ${data}/openbox/sts-rc.xml ${obconf}
fi

# Ob sts-autostart
if [ ! -x "${XDG_CONFIG_HOME}/openbox/sts-autostart" ]; then
	cp ${data}/openbox/sts-autostart ${obconf}
fi

# LXpanel configs
if [ ! -d "${XDG_CONFIG_HOME}/openbox/lxpanel/sts" ]; then
	cp -rf ${data}/lxpanel ${XDG_CONFIG_HOME}
fi

# Start Openbox
exec openbox --config-file ${obconf}/sts-rc.xml \
	--startup ${obconf}/sts-autostart
