#!/bin/sh # # Copyright # # Copyright (C) 2009-2010 Jari Aalto # # License # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . LICENSE="GNU GPL v2 or (at your option) any later" AUTHOR="jari.aalto@cante.net" VERSION="2009.1230.2335" CONF="$HOME/.miwm/session" Help () { echo "\ As MIWM does not have any meny by default to start external programs, this file starts one terminal with the window manager. This program is designed to be used by GDM (etc) from /usr/share/xsessions/miwm.desktop and therefore this program does not exit until Window Manager exists." exit 0 } Version () { echo "$VERSION Copyright (C) $AUTHOR $LICENSE" exit 0 } Warn () { echo "$*" >&2 } Term () { if [ -e /usr/bin/x-terminal-emulator ]; then x-terminal-emulator -display ${DISPLAY:-":0"} & else Warn "$0: No x-terminal-emulator to start" fi } Session () { if [ -f $CONF ]; then sh $CONF else Term fi } Main () { while : do case "$1" in -h|--help) Help ;; -V|--version) Version ;; *) break ;; esac done log=${TMPDIR:-/tmp}/${LOGNAME:-$USER}$$.miwm.log { sleep 4; Session ; } & miwm "$@" 2>&1 | tee $log } Main "$@" # End of file