source: trunk/debathena/debathena/dotfiles/Xsession @ 22966

Revision 22966, 2.1 KB checked in by ghudson, 16 years ago (diff)
Add a bash version of the standard Athena xsession, and use it for bash users.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3# Top level Xsession file for all users
4#
5# $Id: Xsession,v 1.8 2005-12-22 14:54:17 rbasch Exp $
6
7trap "kdestroy; unlog; fsid -u -f $USER; exit 0" 1 2 15
8
9initlib="/usr/lib/init"
10defsession=$1
11defsessioncmd="$2"
12
13if [ -f .noignore ]; then
14        defsession=1;
15fi
16
17if [ "`basename $SHELL`" = bash ]; then
18        default_session=$initlib/xsession.bash
19else
20        default_session=$initlib/xsession
21fi
22
23case $defsession in
241|4|7)
25        if [ -f .xsession ]; then
26                session=.xsession
27        else
28                session=$default_session
29        fi
30        case $defsession in
31        7)
32                session="$session dash"
33                ;;
34        esac
35        ;;
362)
37        session="$default_session -nocalls"
38        ;;
393)
40        session="xterm -ls -geometry 80x24+280+220 -display :0.0"
41        ;;
425)
43        session="$defsessioncmd"
44        ;;
45esac
46
47# Set the tty characteristics of the parent (console window)
48# Redirect stdin since some versions of stty use it instead of stdout.
49if [ "${hosttype}" = "decmips" ]; then
50  stty dec 0<&1 2>/dev/null
51else
52  stty sane 0<&1 2>/dev/null
53fi
54
55# Make random Athena modifications to keymap if required.
56
57test -f /usr/lib/X11/keymaps/AthenaMods && \
58  xmodmap /usr/lib/X11/keymaps/AthenaMods
59
60# Set X screensaver to noblanking to avoid power saving.
61xset s noblank
62
63# Only attempt using bugme if packs are actually available.
64if [ -x /usr/bin/bugme ]; then
65        /usr/bin/bugme $session
66else
67        $session
68fi
69
70status=$?
71if [ $status != 0 ]; then
72                echo ERROR:
73                echo "Xsession returned non-zero status."
74                echo ""
75                echo 'Select the login option to "Ignore your customizations"'
76                echo 'to login and repair your dot files.'
77                kdestroy                        # destroy tickets.
78                sleep 10
79                exit 1
80fi
81
82# Kill mozilla before destroying tokens so that it removes its lock file.
83$initlib/xkill-mozilla
84
85# Make gconfd flush settings to disk before destroying credentials.
86gconftool-2 --shutdown
87
88# Kill xscreensaver, to keep it from trying to restart when we send
89# it SIGHUP below.
90xscreensaver-command -exit > /dev/null 2>&1
91
92# Cannot detach homedir here, since this script is executed in the users
93# homedir.
94
95kdestroy                                # destroy tickets.
96cd /tmp
97unlog
98fsid -u -f $USER > /dev/null 2>&1
99
100sleep 3                                 # let them see any messages (quickly)
101exit 0
Note: See TracBrowser for help on using the repository browser.