1 | #!/bin/sh |
---|
2 | |
---|
3 | # Top level Xsession file for all users |
---|
4 | # |
---|
5 | # $Id: Xsession,v 1.1 1999-11-10 03:50:36 kcr Exp $ |
---|
6 | |
---|
7 | trap "kdestroy; unlog; fsid -u -f $USER; exit 0" 1 2 15 |
---|
8 | |
---|
9 | initlib="/usr/athena/lib/init" |
---|
10 | defsession=$1 |
---|
11 | defsessioncmd="$2" |
---|
12 | |
---|
13 | if [ -f .noignore ]; then |
---|
14 | defsession=1; |
---|
15 | fi |
---|
16 | |
---|
17 | case $defsession in |
---|
18 | 1|4) |
---|
19 | if [ -f .xsession ]; then |
---|
20 | session=".xsession" |
---|
21 | else |
---|
22 | session="$initlib/xsession" |
---|
23 | fi |
---|
24 | ;; |
---|
25 | 2) |
---|
26 | session="$initlib/xsession -nocalls" |
---|
27 | ;; |
---|
28 | 3) |
---|
29 | session="xterm -ls -geometry 80x24+280+220 -display :0.0" |
---|
30 | ;; |
---|
31 | 5) |
---|
32 | session="$defsessioncmd" |
---|
33 | ;; |
---|
34 | esac |
---|
35 | |
---|
36 | # Set the tty characteristics of the parent (console window) |
---|
37 | # Redirect stdin since some versions of stty use it instead of stdout. |
---|
38 | if [ "${hosttype}" = "decmips" ]; then |
---|
39 | stty dec 0<&1 2>/dev/null |
---|
40 | else |
---|
41 | stty sane 0<&1 2>/dev/null |
---|
42 | fi |
---|
43 | |
---|
44 | # Make random Athena modifications to keymap if required. |
---|
45 | |
---|
46 | test -f /usr/athena/lib/X11/keymaps/AthenaMods && \ |
---|
47 | xmodmap /usr/athena/lib/X11/keymaps/AthenaMods |
---|
48 | |
---|
49 | # Set X screensaver to noblanking to avoid power saving. |
---|
50 | xset s noblank |
---|
51 | |
---|
52 | # Only attempt using bugme if packs are actually available. |
---|
53 | if [ -x /usr/athena/bin/bugme ]; then |
---|
54 | /usr/athena/bin/bugme $session |
---|
55 | else |
---|
56 | $session |
---|
57 | fi |
---|
58 | |
---|
59 | status=$? |
---|
60 | if [ $status != 0 ]; then |
---|
61 | echo ERROR: |
---|
62 | echo "Xsession returned non-zero status." |
---|
63 | echo "" |
---|
64 | echo 'Select the login option to "Ignore your customizations"' |
---|
65 | echo 'to login and repair your dot files.' |
---|
66 | kdestroy # destroy tickets. |
---|
67 | sleep 10 |
---|
68 | exit 1 |
---|
69 | fi |
---|
70 | |
---|
71 | |
---|
72 | # Cannot detach homedir here, since this script is executed in the users |
---|
73 | # homedir. |
---|
74 | |
---|
75 | kdestroy # destroy tickets. |
---|
76 | cd /tmp |
---|
77 | unlog |
---|
78 | fsid -u -f $USER > /dev/null 2>&1 |
---|
79 | sleep 3 # let them see any messages (quickly) |
---|
80 | exit 0 |
---|