diff options
Diffstat (limited to 'xinitrc.cpp')
-rw-r--r-- | xinitrc.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/xinitrc.cpp b/xinitrc.cpp index 14d3cbc..1bcfd96 100644 --- a/xinitrc.cpp +++ b/xinitrc.cpp @@ -1,4 +1,5 @@ XCOMM!SHELL_CMD +XCOMM $OpenBSD: xinitrc.cpp,v 1.12 2014/02/26 14:21:28 matthieu Exp $ userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap @@ -39,17 +40,35 @@ if [ -f "$usermodmap" ]; then XMODMAP "$usermodmap" fi -XCOMM start some nice programs +XCOMM if we have private ssh key(s), start ssh-agent and add the key(s) +id1=$HOME/.ssh/identity +id2=$HOME/.ssh/id_dsa +id3=$HOME/.ssh/id_rsa +id4=$HOME/.ssh/id_ecdsa +id5=$HOME/.ssh/id_ed25519 + +if [ -z "$SSH_AGENT_PID" ]; +then + if [ -x /usr/bin/ssh-agent ] && [ -f $id1 -o -f $id2 -o -f $id3 -o -f $id4 -o -f $id5 ]; + then + eval `ssh-agent -s` + ssh-add < /dev/null + fi +fi -if [ -d XINITDIR/xinitrc.d ] ; then - for f in XINITDIR/xinitrc.d/?*.sh ; do - [ -x "$f" ] && . "$f" - done - unset f +XCOMM if dbus is installed, start its daemon +if [ -x /usr/local/bin/dbus-launch -a -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then + eval `dbus-launch --sh-syntax --exit-with-session` fi -TWM & +XCOMM start some nice programs + XCLOCK -geometry 50x50-1+1 & -XTERM -geometry 80x50+494+51 & -XTERM -geometry 80x20+494-0 & -exec XTERM -geometry 80x66+0+0 -name login +XCONSOLE -iconic & +XTERM -geometry 80x24 & +WM || XTERM + +if [ "$SSH_AGENT_PID" ]; then + ssh-add -D < /dev/null + eval `ssh-agent -s -k` +fi |