summaryrefslogtreecommitdiffstats
path: root/remote/modules/xorg/data
diff options
context:
space:
mode:
authorSimon Rettberg2013-05-14 16:41:56 +0200
committerSimon Rettberg2013-05-14 16:41:56 +0200
commit113ce521770232a6d99cdb07dd55d8879214c213 (patch)
treec1233152bfb18b8bd427cf3a1178900bfd768d8c /remote/modules/xorg/data
parentultrastracke 2 (diff)
parentultrastracke update (diff)
downloadtm-scripts-113ce521770232a6d99cdb07dd55d8879214c213.tar.gz
tm-scripts-113ce521770232a6d99cdb07dd55d8879214c213.tar.xz
tm-scripts-113ce521770232a6d99cdb07dd55d8879214c213.zip
Merge branch 'master' of openslx:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/xorg/data')
-rw-r--r--[-rwxr-xr-x]remote/modules/xorg/data/etc/X11/Xsession152
-rw-r--r--remote/modules/xorg/data/usr/share/xsessions/gnome.desktop9
2 files changed, 38 insertions, 123 deletions
diff --git a/remote/modules/xorg/data/etc/X11/Xsession b/remote/modules/xorg/data/etc/X11/Xsession
index e239d586..a9b3d43b 100755..100644
--- a/remote/modules/xorg/data/etc/X11/Xsession
+++ b/remote/modules/xorg/data/etc/X11/Xsession
@@ -1,114 +1,38 @@
-#!/bin/sh
-#
-# /etc/X11/Xsession
-#
-# global Xsession file -- used by display managers and xinit (startx)
-
-# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $
-
-set -e
-
-PROGNAME=Xsession
-
-message () {
- # pretty-print messages of arbitrary length; use xmessage if it
- # is available and $DISPLAY is set
- MESSAGE="$PROGNAME: $*"
- echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
- if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
- echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
- fi
-}
-
-message_nonl () {
- # pretty-print messages of arbitrary length (no trailing newline); use
- # xmessage if it is available and $DISPLAY is set
- MESSAGE="$PROGNAME: $*"
- echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
- if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
- echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
- fi
-}
-
-errormsg () {
- # exit script with error
- message "$*"
- exit 1
-}
-
-internal_errormsg () {
- # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
- # One big call to message() for the sake of xmessage; if we had two then
- # the user would have dismissed the error we want reported before seeing the
- # request to report it.
- errormsg "$*" \
- "Please report the installed version of the \"x11-common\"" \
- "package and the complete text of this error message to" \
- "<debian-x@lists.debian.org>."
-}
-
-# initialize variables for use by all session scripts
-
-OPTIONFILE=/etc/X11/Xsession.options
-
-SYSRESOURCES=/etc/X11/Xresources
-USRRESOURCES=$HOME/.Xresources
-
-SYSSESSIONDIR=/etc/X11/Xsession.d
-USERXSESSION=$HOME/.xsession
-USERXSESSIONRC=$HOME/.xsessionrc
-ALTUSERXSESSION=$HOME/.Xsession
-ERRFILE=$HOME/.xsession-errors
-
-# attempt to create an error file; abort if we cannot
-if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
- [ ! -L "$ERRFILE" ]; then
- chmod 600 "$ERRFILE"
-elif ERRFILE=$(tempfile 2> /dev/null); then
- if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
- message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
- "\"$ERRFILE\"; look for session log/errors in" \
- "\"$TMPDIR/xsession-$USER\"."
- fi
-else
- errormsg "unable to create X session log/error file; aborting."
-fi
-
-# truncate ERRFILE if it is too big to avoid disk usage DoS
-if [ "`stat -c%s \"$ERRFILE\"`" -gt 500000 ]; then
- T=`mktemp -p "$HOME"`
- tail -c 500000 "$ERRFILE" > "$T" && mv -f "$T" "$ERRFILE" || rm -f "$T"
-fi
-
-exec >>"$ERRFILE" 2>&1
-
-echo "$PROGNAME: X session started for $LOGNAME at $(date)"
-
-# Attempt to create a file of non-zero length in /tmp; a full filesystem can
-# cause mysterious X session failures. We do not use touch, :, or test -w
-# because they won't actually create a file with contents. We also let standard
-# error from tempfile and echo go to the error file to aid the user in
-# determining what went wrong.
-WRITE_TEST=$(tempfile)
-if ! echo "*" >>"$WRITE_TEST"; then
- message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
- "with an error"
-fi
-rm -f "$WRITE_TEST"
-
-# use run-parts to source every file in the session directory; we source
-# instead of executing so that the variables and functions defined above
-# are available to the scripts, and so that they can pass variables to each
-# other
-SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
-if [ -n "$SESSIONFILES" ]; then
- set +e
- for SESSIONFILE in $SESSIONFILES; do
- . $SESSIONFILE
- done
- set -e
-fi
-
-exit 0
-
-# vim:set ai et sts=2 sw=2 tw=80:
+#!/bin/bash
+
+#Workaround to start Xsession. The original Xsession script includes error handling functionality and sources other scrips from the Xsession.d/ directory.
+
+#start selected session
+ case "$1" in
+ failsafe)
+ # Failsafe session was requested.
+ if [ -e /usr/bin/xterm ]; then
+ if [ -x /usr/bin/xterm ]; then
+ exec xterm -geometry +1+1
+ else
+ # fatal error
+ errormsg "unable to launch failsafe X session ---" \
+ "x-terminal-emulator not executable; aborting."
+ fi
+ else
+ # fatal error
+ errormsg "unable to launch failsafe X session ---" \
+ "x-terminal-emulator not found; aborting."
+ fi
+ ;;
+ *)
+ # Specific program was requested.
+ STARTUP_FULL_PATH=$(/opt/openslx/usr/bin/which "${1%% *}" || true)
+ if [ -n "$STARTUP_FULL_PATH" ] && [ -e "$STARTUP_FULL_PATH" ]; then
+ if [ -x "$STARTUP_FULL_PATH" ]; then
+ exec $1
+ else
+ message "unable to launch \"$1\" X session ---" \
+ "\"$1\" not executable; falling back to default session."
+ fi
+ else
+ message "unable to launch \"$1\" X session ---" \
+ "\"$1\" not found; falling back to default session."
+ fi
+ ;;
+ esac
diff --git a/remote/modules/xorg/data/usr/share/xsessions/gnome.desktop b/remote/modules/xorg/data/usr/share/xsessions/gnome.desktop
deleted file mode 100644
index cdc66661..00000000
--- a/remote/modules/xorg/data/usr/share/xsessions/gnome.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-X-SuSE-translate=true
-Encoding=UTF-8
-Type=XSession
-Exec=gnome-session
-#TryExec=gnome-session
-Name=GNOME
-Comment=The GNU Network Object Model Environment. A complete, free and easy-to-use desktop environment
-