summaryrefslogtreecommitdiff
path: root/lightdm/Xsession
blob: 4a2a25ea118dce320d5a9339ef3a15f0fdde75b1 (plain)
    1 #!/bin/sh
    2 #
    3 # LightDM wrapper to run around X sessions.
    4 
    5 echo "Running X session wrapper"
    6 
    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"
   12     fi
   13 done
   14 
   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"
   20     fi
   21 done
   22 
   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
   29     fi
   30 done
   31 
   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"
   38         fi
   39     done
   40 fi
   41 
   42 unset XKB_IN_USE
   43 
   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"
   51         fi
   52     done
   53 fi
   54 
   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"
   60 fi
   61 
   62 echo "X session wrapper complete, running session $@"
   63 
   64 exec $@

Generated by cgit