# HG changeset patch # User Christophe Lincoln # Date 1398542779 -7200 # Node ID 41c914508a580a1229a6f783e21826eaca2bf42a # Parent 517828819d8f192083073a74d275cd067e12d5aa Add sts and sts-session diff -r 517828819d8f -r 41c914508a58 sts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sts Sat Apr 26 22:06:19 2014 +0200 @@ -0,0 +1,37 @@ +#!/bin/sh +# +# This tool is used by SliTaz Tiny/Touch Screens desktop. +# +# Copyright (C) 2014 SliTaz ARM - BSD License +# Author: Christophe Lincoln +# + +data="/usr/share/slitaz/sts" +obconf="${XDG_CONFIG_HOME}/openbox" + +case "$1" in + info) + if [ "$STS_DESKTOP_WM" ]; then + echo "STS_DESKTOP_WM : $STS_DESKTOP_WM" + else + echo "The sts desktop is not running" + fi ;; + setup) + # Setup a user session. Openbox configs are setup by sts-session + # but on a system update only $data files are updated so users may + # want to get latest configs with --forced from cmdline or via a + # GUI box. + + # sed -i "//sts-session/" ${XDG_CONFIG_HOME}/slitaz/applications.conf + user=$(id -un) + echo "TODO: sorry $user" ;; + kill) + # Close button on panel so we can have undecorated windows + xid=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2) + pid=$(xprop -id ${xid} _NET_WM_PID | awk '{print $3}') + kill ${pid} ;; + *|help) + echo "$(basename $0) [info|kill]" ;; +esac + +exit 0 diff -r 517828819d8f -r 41c914508a58 sts-session --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sts-session Sat Apr 26 22:06:19 2014 +0200 @@ -0,0 +1,32 @@ +#!/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