3
# LightDM wrapper to run around X sessions.
5
echo "Running X session wrapper"
8
# pretty-print messages of arbitrary length; use xmessage if it
9
# is available and $DISPLAY is set
10
MESSAGE="$PROGNAME: $*"
11
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
12
if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
13
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
18
# exit script with error
24
for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
25
if [ -f "$file" ]; then
26
echo "Loading profile from $file";
32
xresourcedir="/etc/X11/Xresources"
33
if [ -d "$xresourcedir" ]; then
34
for file in $xresourcedir/*; do
35
echo "Loading resource: $file"
36
xrdb -nocpp -merge "$file"
39
xresourcefile="$HOME/.Xresources"
40
if [ -f "$xresourcefile" ]; then
41
echo "Loading resource: $xresourcefile"
42
xrdb -nocpp -merge "$xresourcefile"
46
for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do
47
if [ -f "$file" ]; then
48
echo "Loading keymap: $file"
49
setxkbmap `cat "$file"`
54
# Load xmodmap if not using XKB
55
if [ -z "$XKB_IN_USE" ]; then
56
for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do
57
if [ -f "$file" ]; then
58
echo "Loading modmap: $file"
66
# Run all system xinitrc shell scripts.
67
xinitdir="/etc/X11/xinit/xinitrc.d"
68
if [ -d "$xinitdir" ]; then
69
for script in $xinitdir/*; do
70
echo "Loading xinit script $script"
71
if [ -x "$script" -a ! -d "$script" ]; then
77
# Load Xsession scripts
78
# OPTIONFILE, USERXSESSION, USERXSESSIONRC and ALTUSERXSESSION are required
79
# by the scripts to work
80
xsessionddir="/etc/X11/Xsession.d"
81
OPTIONFILE=/etc/X11/Xsession.options
82
USERXSESSION=$HOME/.xsession
83
USERXSESSIONRC=$HOME/.xsessionrc
84
ALTUSERXSESSION=$HOME/.Xsession
86
if [ -d "$xsessionddir" ]; then
87
for i in `ls $xsessionddir`; do
88
script="$xsessionddir/$i"
89
echo "Loading X session script $script"
90
if [ -r "$script" -a -f "$script" ] && expr "$i" : '^[[:alnum:]_-]\+$' > /dev/null; then
96
echo "X session wrapper complete, running session $@"