updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / lightdm-gtk2 / Xsession
blob5da041e6d7ec14e866e9a28f67893428c6014050
1 #!/bin/sh
3 # LightDM wrapper to run around X sessions.
5 echo "Running X session wrapper"
7 # Load profile
8 for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
9 if [ -f "$file" ]; then
10 echo "Loading profile from $file";
11 . "$file"
13 done
15 # Load resources
16 for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
17 if [ -f "$file" ]; then
18 echo "Loading resource: $file"
19 xrdb -nocpp -merge "$file"
21 done
23 # Load keymaps
24 for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do
25 if [ -f "$file" ]; then
26 echo "Loading keymap: $file"
27 setxkbmap `cat "$file"`
28 XKB_IN_USE=yes
30 done
32 # Load xmodmap if not using XKB
33 if [ -z "$XKB_IN_USE" ]; then
34 for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do
35 if [ -f "$file" ]; then
36 echo "Loading modmap: $file"
37 xmodmap "$file"
39 done
42 unset XKB_IN_USE
44 # Run all system xinitrc shell scripts.
45 xinitdir="/etc/X11/xinit/xinitrc.d"
46 if [ -d "$xinitdir" ]; then
47 for script in $xinitdir/*; do
48 echo "Loading xinit script $script"
49 if [ -x "$script" -a ! -d "$script" ]; then
50 . "$script"
52 done
55 # Load Xsession scripts
56 xsessionddir="/etc/X11/Xsession.d"
57 if [ -d "$xsessionddir" ]; then
58 for i in `ls $xsessionddir`; do
59 script="$xsessionddir/$i"
60 echo "Loading X session script $script"
61 if [ -r "$script" -a -f "$script" ] && expr "$i" : '^[[:alnum:]_-]\+$' > /dev/null; then
62 . "$script"
64 done
67 echo "X session wrapper complete, running session $@"
69 exec $@