\chapter{Démarrage de la session graphique}
\label{chap:startx_bornes}

\begin{lstlisting}[language=bash, caption={Ce script démarre la session 
graphique pour l'utilisateur \textit{pointcaf}}]
#!/bin/sh
export XDG_CONFIG_HOME="${HOME}/.config"
# env variable for touchscreen support on firefox
export MOZ_USE_XINPUT2=1
eval `dbus-launch --sh-syntax --exit-with-session`
xfsettingsd &
xfwm4 --daemon
xfdesktop&
# start up stuff in $XDG_CONFIG_HOME/autostart/
if test -d "$XDG_CONFIG_HOME/autostart"; then
  for i in ${XDG_CONFIG_HOME}/autostart/*.desktop; do
    grep -q -E "^Hidden=true" "$i" && continue
    if grep -q -E "^OnlyShowIn=" "$i"; then
      # need to test twice, as lack of the line entirely means we still run it
      grep -E "^OnlyShowIn=" "$i" | grep -q 'XFCE;' || continue
    fi
    grep -E "^NotShowIn=" "$i" | grep -q 'XFCE;' && continue
    # check for TryExec
    trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
    if test "$trycmd"; then
      command -v "$trycmd" >/dev/null 2>&1 || continue
    fi
    cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
    if test "$cmd" && command -v "$cmd" >/dev/null 2>&1; then
      $cmd &
    fi
  done
fi
# Add dconf
if [ -f "${XDG_CONFIG_HOME}/dconf-backup/plank.dconf" ]
then
	dconf load /net/launchpad/plank/ < ${XDG_CONFIG_HOME}/dconf-backup/plank.dconf
else
	echo "plank not found" >>~/plank.log
fi
xautolock -time 10 -locker lockxcab &
xfce4-panel
\end{lstlisting}
