[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force X.Org X11 SVN commit: r1722 - in branches/modular/debian/xorg/debian: . local local/Xsession.d



Author: dnusinow
Date: 2006-04-06 23:34:12 -0500 (Thu, 06 Apr 2006)
New Revision: 1722

Added:
   branches/modular/debian/xorg/debian/local/Xsession
   branches/modular/debian/xorg/debian/local/Xsession.5
   branches/modular/debian/xorg/debian/local/Xsession.d/
   branches/modular/debian/xorg/debian/local/Xsession.d/20x11-common_process-args
   branches/modular/debian/xorg/debian/local/Xsession.d/30x11-common_xresources
   branches/modular/debian/xorg/debian/local/Xsession.d/50x11-common_determine-startup
   branches/modular/debian/xorg/debian/local/Xsession.d/90x11-common_ssh-agent
   branches/modular/debian/xorg/debian/local/Xsession.d/99x11-common_start
   branches/modular/debian/xorg/debian/local/Xsession.options
   branches/modular/debian/xorg/debian/local/Xsession.options.5
Modified:
   branches/modular/debian/xorg/debian/changelog
   branches/modular/debian/xorg/debian/x11-common.install
Log:
* Put the Xsession stuff back in to x11-common. Thanks Arjan Oosting.
  (closes: #361025)

Modified: branches/modular/debian/xorg/debian/changelog
===================================================================
--- branches/modular/debian/xorg/debian/changelog	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/changelog	2006-04-07 04:34:12 UTC (rev 1722)
@@ -1,3 +1,10 @@
+xorg (1:7.0.9) experimental; urgency=low
+
+  * Put the Xsession stuff back in to x11-common. Thanks Arjan Oosting.
+    (closes: #361025)
+
+ -- David Nusinow <dnusinow@debian.org>  Fri,  7 Apr 2006 00:27:00 -0400
+
 xorg (1:7.0.8) experimental; urgency=low
 
   * Add vars files for alpha, m68k, mips, mipsel, and arm. These are crude

Added: branches/modular/debian/xorg/debian/local/Xsession
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,128 @@
+#!/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>."
+}
+
+run_parts () {
+  # until run-parts --noexec is implemented
+  if [ -z "$1" ]; then
+    internal_errormsg "run_parts() called without an argument."
+  fi
+  if [ ! -d "$1" ]; then
+    internal_errormsg "run_parts() called, but \"$1\" does not exist or is" \
+                      "not a directory."
+  fi
+  for F in $(/bin/ls $1); do
+    if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
+      if [ -f "$1/$F" ]; then
+        echo "$1/$F"
+      fi
+    fi
+  done
+}
+
+# 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
+ALTUSERXSESSION=$HOME/.Xsession
+ERRFILE=$HOME/.xsession-errors
+
+# attempt to create an error file; abort if we cannot
+if 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
+
+exec >>"$ERRFILE" 2>&1
+
+echo "$PROGNAME: X session started for $LOGNAME at $(date)"
+
+# sanity check; is our session script directory present?
+if [ ! -d "$SYSSESSIONDIR" ]; then
+  errormsg "no \"$SYSSESSIONDIR\" directory found; aborting."
+fi
+
+# 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 $SYSSESSIONDIR)
+if [ -n "$SESSIONFILES" ]; then
+  for SESSIONFILE in $SESSIONFILES; do
+    . $SESSIONFILE
+  done
+fi
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.5
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.5	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.5	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,402 @@
+.\" $Id: Xsession.5 470 2005-08-02 01:08:36Z dnusinow $
+.\"
+.\" Copyright 1998-2004 Branden Robinson <branden@debian.org>.
+.\"
+.\" This is free software; you may 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,
+.\" or (at your option) any later version.
+.\"
+.\" This 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 with
+.\" the Debian operating system, in /usr/share/common-licenses/GPL;  if
+.\" not, write to the Free Software Foundation, Inc., 59 Temple Place,
+.\" Suite 330, Boston, MA 02111-1307 USA
+.TH Xsession 5 "2004\-11\-04" "Debian Project"
+.SH NAME
+Xsession \- initialize X session
+.SH SYNOPSIS
+Xsession [
+.I session\-type
+]
+.SH DESCRIPTION
+.I /etc/X11/Xsession
+is a Bourne shell
+.RB ( sh (1))
+script which is run when an X Window System
+session is begun by
+.BR startx (1x)
+or a display manager such as
+.BR xdm (1x).
+(Some display managers only invoke
+.I Xsession
+when specifically directed to so by the user; see the documentation for
+your display manager to find out more.)
+Administrators unfamiliar with the Bourne shell will likely find the
+.BR Xsession.options (5)
+configuration file easier to deal with than
+.I Xsession
+itself.
+.PP
+.I Xsession
+is not intended to be invoked directly by the user; to be effective it
+needs to run in a special environment associated with X server
+initialization.
+.BR startx ,
+.BR xdm ,
+.BR xinit (1x),
+and other similar programs handle this.
+.PP
+By default on a Debian system,
+.I Xsession
+is used by both common methods of starting the X Window System,
+.B xdm
+(or another X display manager) and
+.BR startx .
+To change this for
+.BR xdm,
+edit the \(oqDisplayManager*session\(cq resource in the
+.I /etc/X11/xdm/xdm\-config
+file \(em for other display managers, consult their documentation.
+To stop
+.B startx
+from using
+.I Xsession
+by default, replace the contents of the
+.I /etc/X11/xinit/xinitrc
+file.
+.PP
+The
+.I Xsession
+script is quite flexible, and extensive customization of the X startup
+procedure is possible without modifying the script itself.
+See \(lqCUSTOMIZING THE STARTUP PROCEDURE\(rq below.
+.SS "SESSION TYPES"
+.I Xsession
+may optionally be passed a single argument indicating the type of X
+session to be started.
+It is up to the display manager to set the argument, and there is no way to
+pass
+.I Xsession
+an argument from
+.B startx
+or
+.BR xinit .
+By default, three different arguments are supported:
+.TP
+.B failsafe
+invokes a session consisting solely of an
+.BR x\-terminal\-emulator (1)
+(no window manager is launched).
+If the
+.B x\-terminal\-emulator program cannot
+be found, the session exits.
+The \(oqfailsafe\(cq argument is ignored if there is no
+\(oqallow\-failsafe\(cq line in
+.IR Xsession.options .
+.TP
+.B default
+produces the same behavior as if no session type argument had been given at
+all.
+.TP
+.I program
+starts
+.I program
+if it can be found in the $PATH.
+This is usually a session manager or a very featureful window manager.
+If
+.I program
+is not found, the
+.I Xsession
+script proceeds with its default behavior.
+This argument is ignored if there is no \(oqallow\-user\-xsession\(cq line
+in
+.IR Xsession.options .
+(If the administrator does not want users writing their own
+.I .Xsession
+files, it makes little sense to permit them to specify the names of
+arbitrary programs to run.)
+.SS "DEFAULT STARTUP PROCEDURE"
+Initially,
+.I Xsession
+performs some housekeeping.
+It declares a set of built\-in functions (see
+\(lqBUILT\-IN SHELL FUNCTIONS\(rq below) and variables, then attempts to
+create a log file for the X session, or append to an existing one.
+Historically this is called an \(oqerror\(cq file, but it catches all sorts
+of diagnostic output from various X clients run in the user's session, not
+just error messages.
+If it is impossible to write to an error file, the script (and thus the X
+session) aborts.
+For convenience, once the error file is successfully opened,
+.I Xsession
+reports the fact that the session has started, the invoking username, and
+the date to the error file.
+This makes it easier to discern which X session produced a particular line
+of output in the file.
+.PP
+.I Xsession
+next confirms that its script directory,
+.IR Xsession.d ,
+exists.
+If it does not, the script aborts.
+After the script directory is confirmed to be present,
+.I Xsession
+uses
+.BR run\-parts (1)
+to identify files in that directory that should be sourced (executed) in the
+shell's environment.
+Only files named in a certain way are sourced; see the
+.B run\-parts
+manual page for a description of valid characters in the filename.
+(This restriction enables the administrator to move experimental or
+problematic files out of the way of the script but keep them in an obvious
+place, for instance by renaming them with \(oq.old\(cq or \(oq.broken\(cq
+appended to the filename.)
+.SS "SUPPLIED SCRIPTS"
+Five shell script portions are supplied by default to handle the details of
+the session startup procedure.
+.TP
+.I /etc/X11/Xsession.d/20x11\-common_process\-args
+Arguments are processed as described in \(lqSESSION TYPES\(rq above.
+The startup program, if one is identified at this point, is merely stored
+for later reference, and not immediately executed.
+.TP
+.I /etc/X11/Xsession.d/30x11\-common_xresources
+X resources are merged.
+.B run\-parts
+is again used, this time to identify files in the
+.I /etc/X11/Xresources
+directory that should be processed with \(oqxrdb \-merge\(cq.
+Next, if the line \(oqallow\-user\-resources\(cq is present in
+.IR Xsession.options ,
+the user's
+.I $HOME/.Xresources
+file is merged in the same way.
+.TP
+.I /etc/X11/Xsession.d/50x11\-common_determine\-startup
+Determine startup program.
+The X client to launch as the controlling process (the one that, upon
+exiting, causes the X server to exit as well) is determined next.
+If a program or failsafe argument was given and is allowed (see above), it
+is used as the controlling process.
+Otherwise, if the line \(oqallow\-user\-xsession\(cq is present in
+.IR Xsession.options ,
+a user\-specified session program or script is used.
+In the latter case, two historically popular names for user X session
+scripts are searched for:
+.IR $HOME/.xsession
+and
+.IR $HOME/.Xsession
+(note the difference in case).
+The first one found is used.
+If the script is not executable, it is marked to be executed with the
+Bourne shell interpreter,
+.BR sh .
+Finally, if none of the above succeeds, the following programs are searched
+for:
+.IR /usr/bin/x\-session\-manager ,
+.IR /usr/bin/x\-window\-manager ,
+and
+.IR /usr/bin/x\-terminal\-emulator .
+The first one found is used.
+If none are found,
+.I Xsession
+aborts with an error.
+.TP
+.I /etc/X11/Xsession.d/90x11\-common_ssh\-agent
+Start
+.BR ssh\-agent (1),
+if needed.
+If the line \(oquse\-ssh\-agent\(cq is present in
+.IR Xsession.options ,
+and no SSH agent process appears to be running already,
+.B ssh\-agent
+is marked to be used to execute the startup program determined previously.
+.B Note:
+this functionality may move to the ssh package in the future.
+.TP
+.I /etc/X11/Xsession.d/99x11\-common_start
+Start the X session.
+The startup program is executed, inside a Bourne shell if it is not
+executable, and inside an ssh\-agent if necessary.
+The shell's
+.B exec
+command is used to spare a slot in the process table.
+.SS "CUSTOMIZING THE STARTUP PROCEDURE"
+Of course, any of the existing files can be edited in place.
+.PP
+Because the order in which the various scripts in
+.I /etc/X11/Xsession.d
+are executed is important, files to be added to this directory should
+have a well\-formed name.
+The following format is recommended:
+.PP
+* a two\-digit number denoting sequence;
+.PP
+* the name of the package providing the script (or \(oqcustom\(cq for
+locally\-created scripts);
+.PP
+* an underscore;
+.PP
+* a description of the script's basic function, using only characters allowed
+by
+.BR run\-parts .
+.PP
+Here is an example of how one might write a script, named
+.IR 40custom_load\-xmodmap ,
+to invoke
+.BR xmodmap (1x):
+.PP
+.nf
+SYSMODMAP="/etc/X11/Xmodmap"
+USRMODMAP="$HOME/.Xmodmap"
+.PP
+if [ \-x /usr/bin/X11/xmodmap ]; then
+    if [ \-f "$SYSMODMAP" ]; then
+        xmodmap "$SYSMODMAP"
+    fi
+fi
+.PP
+if [ \-x /usr/bin/X11/xmodmap ]; then
+    if [ \-f "$USRMODMAP" ]; then
+        xmodmap "$USRMODMAP"
+    fi
+fi
+.fi
+.PP
+Those writing scripts for
+.I Xsession
+to execute should avail themselves of its built\-in shell functions,
+described below.
+.SS "BUILT\-IN SHELL FUNCTIONS"
+.B message
+is used for communicating with the user.
+It is a wrapper for the
+.BR echo (1)
+command and relies upon
+.B echo
+for its argument processing.
+This function may be given an arbitrarily long message string, which is
+formatted to the user's terminal width (breaking lines at whitespace) and
+sent to standard error.
+If the
+.I DISPLAY
+environment variable is set and the
+.BR xmessage (1x)
+program is available,
+.B xmessage
+is also used to display the message.
+.PP
+.B message_nonl
+is used for communicating with the user when a trailing newline is
+undesirable; it omits a trailing newline from the message text.
+It otherwise works as
+.BR message .
+.PP
+.B errormsg
+is used for indicating an error condition and aborting the script.
+It works as
+.BR message ,
+above, except that after displaying the message, it will exit
+.I Xsession
+with status 1.
+.SH ENVIRONMENT
+The following environment variables affect the execution of
+.IR Xsession :
+.TP
+.B HOME
+specifies the user's home directory; various files are searched for here.
+.TP
+.B TMPDIR
+names a default directory for temporary files; if the standard X session
+error file cannot be opened, this variable is used to locate a place for
+one.
+.TP
+.B COLUMNS
+indicates the width of terminal device in character cells.
+This value is used for formatting diagnostic messages.
+.SH "INPUT FILES"
+.TP
+.I /etc/X11/Xsession.d/
+is a directory containing Bourne shell scripts to be executed by
+.IR Xsession .
+Files in this directory are matched using
+.B run\-parts
+and are
+.BR source d,
+not executed in a subshell.
+.TP
+.I /etc/X11/Xresources/
+is a directory containing files corresponding to Debian package names, each of
+which contains system\-wide X resource settings for X clients from the
+corresponding package.
+The settings are loaded with
+.BR "xrdb \-merge" .
+Files in this directory are matched using
+.BR run\-parts .
+.TP
+.I /etc/X11/Xsession.options
+contains configuration options for the
+.I /etc/X11/Xsession
+script.
+See
+.BR Xsession.options (5)
+for more information.
+.TP
+.I $HOME/.Xresources
+contains X resources specific to the invoking user's environment.
+The settings are loaded with
+.BR "xrdb \-merge" .
+Note that
+.I $HOME/.Xdefaults
+is a relic from X Version 10 (and X11R1) days, before app\-defaults files
+were implemented.
+It has been deprecated for over ten years at the time of this writing.
+.I .Xresources
+should be used instead.
+.TP
+.I $HOME/.Xsession
+is a sequence of commands invoking X clients (or a session manager such as
+.BR xsm (1x)).
+See the manual page for
+.B xinit
+and/or
+.I /usr/share/doc/x11\-common/examples/xsession
+for tips on writing an
+.I .Xsession
+file.
+.SH "OUTPUT FILES"
+.TP
+.I $HOME/.xsession\-errors
+is where standard output and standard error for
+.I Xsession
+script and all X client processes are directed by default.
+.TP
+.I $TMPDIR/filename
+is where the X session error file is placed if
+.I $HOME/.xsession\-errors
+cannot be opened.
+For security reasons, the exact filename is randomly generated by
+.BR tempfile (1).
+.SH AUTHORS
+Stephen Early, Mark Eichin, and Branden Robinson developed Debian's X
+session handling scripts.
+Branden Robinson wrote this manual page.
+.SH "SEE ALSO"
+.BR Xsession.options (5),
+.BR X (7x),
+.BR run\-parts (1),
+.BR ssh\-agent (1),
+.BR startx (1x),
+.BR tempfile (1),
+.BR xdm (1x),
+.BR xmessage (1x),
+.BR xmodmap (1x),
+.BR xrdb (1x),
+.BR sh (1)
+.\" vim:set et tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.d/20x11-common_process-args
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.d/20x11-common_process-args	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.d/20x11-common_process-args	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,58 @@
+# $Id: 20x11-common_process-args 305 2005-07-03 18:51:43Z dnusinow $
+
+# This file is sourced by Xsession(5), not executed.
+
+# Determine how many arguments were provided.
+case $# in
+  0)
+    # No arguments given; use default behavior.
+    ;;
+  1)
+    # One argument given; see what it was.
+    case "$1" in
+      failsafe)
+        # Failsafe session was requested.
+        if grep -qs ^allow-failsafe "$OPTIONFILE"; then
+          if [ -e /usr/bin/x-terminal-emulator ]; then
+            if [ -x /usr/bin/x-terminal-emulator ]; then
+              exec x-terminal-emulator -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
+        fi
+        ;;
+      default)
+        # Default behavior was requested.
+        ;;
+      *)
+        # Specific program was requested.
+        STARTUP_FULL_PATH=$(which $1 || true)
+        if [ -n "$STARTUP_FULL_PATH" ] && [ -e "$STARTUP_FULL_PATH" ]; then
+          if [ -x "$STARTUP_FULL_PATH" ]; then
+            STARTUP="$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
+    ;;
+  *)
+    # More than one argument given; we don't know what to do.
+    message "unsupported number of arguments ($#); falling back to default" \
+            "session."
+    ;;
+esac
+
+# vim:set ai et sts=2 sw=2 tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.d/30x11-common_xresources
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.d/30x11-common_xresources	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.d/30x11-common_xresources	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,28 @@
+# $Id: 30x11-common_xresources 305 2005-07-03 18:51:43Z dnusinow $
+
+# This file is sourced by Xsession(5), not executed.
+
+# If xrdb (from xbase-clients) is installed, merge system-wide X resources.
+# Then merge the user's X resources, if the options file is so configured.
+if which xrdb >/dev/null 2>&1; then
+  if [ -d "$SYSRESOURCES" ]; then
+    RESOURCEFILES=$(run-parts --list $SYSRESOURCES)
+    if [ -n "$RESOURCEFILES" ]; then
+      for RESOURCEFILE in $RESOURCEFILES; do
+        xrdb -merge $RESOURCEFILE
+      done
+    fi
+  fi
+
+  if grep -qs ^allow-user-resources "$OPTIONFILE"; then
+    if [ -f "$USRRESOURCES" ]; then
+      xrdb -merge $USRRESOURCES
+    fi
+  fi
+else
+  # Comment out this command if you desire a legacy-free X environment, and find
+  # the warning spurious.
+  message "warning: xrdb command not found; X resources not merged."
+fi
+
+# vim:set ai et sts=2 sw=2 tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.d/50x11-common_determine-startup
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.d/50x11-common_determine-startup	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.d/50x11-common_determine-startup	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,46 @@
+# $Id: 50x11-common_determine-startup 305 2005-07-03 18:51:43Z dnusinow $
+
+# This file is sourced by Xsession(5), not executed.
+
+# If no X session startup program was passed to the Xsession script as an
+# argument (e.g., by the display manager), or if that program was not
+# executable, fall back to looking for a user's custom X session script, if
+# allowed by the options file.
+if [ -z "$STARTUP" ]; then
+  if grep -qs ^allow-user-xsession "$OPTIONFILE"; then
+    for STARTUPFILE in "$USERXSESSION" "$ALTUSERXSESSION"; do
+      if [ -e "$STARTUPFILE" ]; then
+        if [ -x "$STARTUPFILE" ]; then
+          STARTUP="$STARTUPFILE"
+        else
+          STARTUP="sh $STARTUPFILE"
+        fi
+        break
+      fi
+    done
+  fi
+fi
+
+# If there is still nothing to use for a startup program, try the system
+# default session manager, window manager, and terminal emulator.
+if [ -z "$STARTUP" ]; then
+  if [ -x /usr/bin/x-session-manager ]; then
+    STARTUP=x-session-manager
+  elif [ -x /usr/bin/x-window-manager ]; then
+    STARTUP=x-window-manager
+  elif [ -x /usr/bin/x-terminal-emulator ]; then
+    STARTUP=x-terminal-emulator
+  fi
+fi
+
+# If we still have not found a startup program, give up.
+if [ -z "$STARTUP" ]; then
+  ERRMSG="unable to start X session ---"
+  if grep -qs ^allow-user-xsession "$OPTIONFILE"; then
+    ERRMSG="$ERRMSG no \"$USERXSESSION\" file, no \"$ALTUSERXSESSION\" file,"
+  fi
+  errormsg "$ERRMSG no session managers, no window managers, and no terminal" \
+           "emulators found; aborting."
+fi
+
+# vim:set ai et sts=2 sw=2 tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.d/90x11-common_ssh-agent
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.d/90x11-common_ssh-agent	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.d/90x11-common_ssh-agent	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,24 @@
+# $Id: 90x11-common_ssh-agent 305 2005-07-03 18:51:43Z dnusinow $
+
+# This file is sourced by Xsession(5), not executed.
+
+STARTSSH=
+SSHAGENT=/usr/bin/ssh-agent
+SSHAGENTARGS=
+
+if grep -qs ^use-ssh-agent "$OPTIONFILE"; then
+  if [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \
+     && [ -z "$SSH2_AUTH_SOCK" ]; then
+    STARTSSH=yes
+    if [ -f /usr/bin/ssh-add1 ] && cmp -s $SSHAGENT /usr/bin/ssh-agent2; then
+      # use ssh-agent2's ssh-agent1 compatibility mode
+      SSHAGENTARGS=-1
+    fi
+  fi
+fi
+
+if [ -n "$STARTSSH" ]; then
+  STARTUP="$SSHAGENT $SSHAGENTARGS $STARTUP"
+fi
+
+# vim:set ai et sts=2 sw=2 tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.d/99x11-common_start
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.d/99x11-common_start	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.d/99x11-common_start	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,7 @@
+# $Id: 99x11-common_start 305 2005-07-03 18:51:43Z dnusinow $
+
+# This file is sourced by Xsession(5), not executed.
+
+exec $STARTUP
+
+# vim:set ai et sts=2 sw=2 tw=80:

Added: branches/modular/debian/xorg/debian/local/Xsession.options
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.options	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.options	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,9 @@
+# $Id: Xsession.options 189 2005-06-11 00:04:27Z branden $
+#
+# configuration options for /etc/X11/Xsession
+# See Xsession.options(5) for an explanation of the available options.
+allow-failsafe
+allow-user-resources
+allow-user-xsession
+use-ssh-agent
+use-session-dbus

Added: branches/modular/debian/xorg/debian/local/Xsession.options.5
===================================================================
--- branches/modular/debian/xorg/debian/local/Xsession.options.5	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/local/Xsession.options.5	2006-04-07 04:34:12 UTC (rev 1722)
@@ -0,0 +1,91 @@
+.\" $Id: Xsession.options.5 189 2005-06-11 00:04:27Z branden $
+.\"
+.\" Copyright 1998-2001, 2003-2004 Branden Robinson <branden@debian.org>.
+.\"
+.\" This is free software; you may 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,
+.\" or (at your option) any later version.
+.\"
+.\" This 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 with
+.\" the Debian operating system, in /usr/share/common-licenses/GPL;  if
+.\" not, write to the Free Software Foundation, Inc., 59 Temple Place,
+.\" Suite 330, Boston, MA 02111-1307 USA
+.TH Xsession.options 5 "2004\-10\-31" "Debian Project"
+.SH NAME
+Xsession.options \- configuration options for
+.BR Xsession (5)
+.SH DESCRIPTION
+.I /etc/X11/Xsession.options
+contains a set of flags that determine some of the behavior of the
+.BR Xsession (5)
+Bourne shell
+.RB ( sh (1))
+script.
+See the
+.BR Xsession (5)
+manpage for further information.
+.PP
+.I Xsession.options
+may contain comments, which begin with a hash mark (\(oq#\(cq) and end at
+the next newline, just like comments in shell scripts.
+The rest of the file consists of options which are expressed as words
+separated by hyphens, with only one option per line.
+Options are enabled by simply placing them in the file; they are disabled
+by prefixing the option name with \(oqno\-\(cq.
+.PP
+Available options are:
+.TP
+.B allow\-failsafe
+If the \(oqfailsafe\(cq argument is passed to the
+.I Xsession
+script, an emergency X session is invoked, consisting of only an
+.BR x\-terminal\-emulator (1)
+in the upper\-left hand corner of the screen.
+No window manager is started.
+If an
+.B x\-terminal\-emulator
+program is not available, the session exits immediately.
+.TP
+.B allow\-user\-resources
+If users have a file called
+.I .Xresources
+in their home directories, these resources will be merged with the default
+X resources when they log in.
+.TP
+.B allow\-user\-xsession
+If users have an executable file called
+.I .Xsession
+in their home directories, it can be used as the startup program for the X
+session (see
+.BR Xsession (5)).
+If the file is present but not executable, it may still be used, but is
+assumed to be a Bourne shell script, and executed with
+.BR sh (1).
+.TP
+.B use\-ssh\-agent
+If the
+.BR ssh\-agent (1)
+program is available and no agent process appears to be running already,
+the X session will be invoked by exec'ing
+.B ssh\-agent
+with the startup command, instead of the startup command directly.
+.PP
+All of the above options are enabled by default.
+Additional options may be supported by the local administrator.
+.BR Xsession (5)
+describes how this is accomplished.
+.SH AUTHORS
+Stephen Early, Mark Eichin, and Branden Robinson developed Debian's X
+session handling scripts.
+Branden Robinson wrote this manual page.
+.SH SEE ALSO
+.BR Xsession (5),
+.BR ssh\-agent (1),
+.BR x\-terminal\-emulator (1)
+.\" vim:set et tw=80:

Modified: branches/modular/debian/xorg/debian/x11-common.install
===================================================================
--- branches/modular/debian/xorg/debian/x11-common.install	2006-04-07 03:11:47 UTC (rev 1721)
+++ branches/modular/debian/xorg/debian/x11-common.install	2006-04-07 04:34:12 UTC (rev 1722)
@@ -1,3 +1,8 @@
 debian/local/X usr/bin
 debian/local/dexconf usr/bin
 debian/local/rgb.txt etc/X11
+debian/local/Xsession etc/X11
+debian/local/Xsession.5 usr/share/man/man5
+debian/local/Xsession.d etc/X11
+debian/local/Xsession.options etc/X11
+debian/local/Xsession.options.5 usr/share/man/man5



Reply to: