#!/bin/sh # wm2.xsession is called when a desktop environment is in use. It loads ssh # identities (if needed), then execs the actual window manager. The script # expects the name (full path name OK) of the window manager on the command # line, and its arguments if any. if [ -n "$SSH_AUTH_SOCK" ] ; then # The ssh agent is running. But did PAM load identities as # it should? If not, load the identities now. missiden="" for f in $HOME/.ssh/id_* ; do fb=`basename $f` case $fb in id_*.pub | id_\* ) : ;; id_*) if ssh-add -l | grep -w $fb > /dev/null ; then : ; else # This identity is not present. missiden="$missiden $fb" fi ;; esac done if [ -n "$missiden" ] ; then echo "ssh-add the missing identities: $missiden" (cd $HOME/.ssh ; ssh-add $missiden < /dev/null ) fi fi # Finally, start the window manager. exec "$@" echo "Failed to exec the window manager. Command was:" 1>&2 echo "$*" 1>&2 exit 8