sts rev 1

Add sts and sts-session
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 26 22:06:19 2014 +0200 (2014-04-26)
parents 517828819d8f
children df33bacb06af
files sts sts-session
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sts	Sat Apr 26 22:06:19 2014 +0200
     1.3 @@ -0,0 +1,37 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# This tool is used by SliTaz Tiny/Touch Screens desktop.
     1.7 +#
     1.8 +# Copyright (C) 2014 SliTaz ARM - BSD License
     1.9 +# Author: Christophe Lincoln <pankso@slitaz.org>
    1.10 +#
    1.11 +
    1.12 +data="/usr/share/slitaz/sts"
    1.13 +obconf="${XDG_CONFIG_HOME}/openbox"
    1.14 +
    1.15 +case "$1" in
    1.16 +	info)
    1.17 +		if [ "$STS_DESKTOP_WM" ]; then
    1.18 +			echo "STS_DESKTOP_WM : $STS_DESKTOP_WM"
    1.19 +		else
    1.20 +			echo "The sts desktop is not running"
    1.21 +		fi ;;
    1.22 +	setup)
    1.23 +		# Setup a user session. Openbox configs are setup by sts-session
    1.24 +		# but on a system update only $data files are updated so users may
    1.25 +		# want to get latest configs with --forced from cmdline or via a
    1.26 +		# GUI box.
    1.27 +		
    1.28 +		# sed -i "//sts-session/" ${XDG_CONFIG_HOME}/slitaz/applications.conf
    1.29 +		user=$(id -un)
    1.30 +		echo "TODO: sorry $user" ;;
    1.31 +	kill)
    1.32 +		# Close button on panel so we can have undecorated windows
    1.33 +		xid=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)
    1.34 +		pid=$(xprop -id ${xid} _NET_WM_PID | awk '{print $3}')
    1.35 +		kill ${pid} ;;
    1.36 +	*|help)
    1.37 +		echo "$(basename $0) [info|kill]" ;;
    1.38 +esac
    1.39 +
    1.40 +exit 0
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/sts-session	Sat Apr 26 22:06:19 2014 +0200
     2.3 @@ -0,0 +1,32 @@
     2.4 +#!/bin/sh
     2.5 +#
     2.6 +# Start SliTaz Tiny/Touch Screens desktop session
     2.7 +#
     2.8 +
     2.9 +export STS_DESKTOP_WM="openbox"
    2.10 +export XDG_CACHE_HOME="$HOME/.cache"
    2.11 +export XDG_CONFIG_HOME="$HOME/.config"
    2.12 +export XDG_DATA_HOME="$HOME/.local/share"
    2.13 +
    2.14 +data="/usr/share/slitaz/sts"
    2.15 +obconf="${XDG_CONFIG_HOME}/openbox"
    2.16 +
    2.17 +# Ob sts-rc.xml
    2.18 +if [ ! -f "${XDG_CONFIG_HOME}/openbox/sts-rc.xml" ]; then
    2.19 +	mkdir -p ${obconf}
    2.20 +	cp ${data}/openbox/sts-rc.xml ${obconf}
    2.21 +fi
    2.22 +
    2.23 +# Ob sts-autostart
    2.24 +if [ ! -x "${XDG_CONFIG_HOME}/openbox/sts-autostart" ]; then
    2.25 +	cp ${data}/openbox/sts-autostart ${obconf}
    2.26 +fi
    2.27 +
    2.28 +# LXpanel configs
    2.29 +if [ ! -d "${XDG_CONFIG_HOME}/openbox/lxpanel/sts" ]; then
    2.30 +	cp -rf ${data}/lxpanel ${XDG_CONFIG_HOME}
    2.31 +fi
    2.32 +
    2.33 +# Start Openbox
    2.34 +exec openbox --config-file ${obconf}/sts-rc.xml \
    2.35 +	--startup ${obconf}/sts-autostart