db-move: moved polari from [testing] to [extra] (x86_64)
[arch-packages.git] / lightdm / trunk / Xsession
blob4a2a25ea118dce320d5a9339ef3a15f0fdde75b1
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 -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 # Run user xsession shell script
56 script="$HOME/.xsession"
57 if [ -x "$script" -a ! -d "$script" ]; then
58 echo "Loading xsession script $script"
59 . "$script"
62 echo "X session wrapper complete, running session $@"
64 exec $@