xenocara/app/xinit/xinitrc.cpp

75 lines
1.5 KiB
C++
Raw Normal View History

XCOMM!SHELL_CMD
XCOMM $OpenBSD: xinitrc.cpp,v 1.12 2014/02/26 14:21:28 matthieu Exp $
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=XINITDIR/.Xresources
sysmodmap=XINITDIR/.Xmodmap
XCOMM merge in defaults and keymaps
if [ -f $sysresources ]; then
#ifdef __APPLE__
if [ -x /usr/bin/cpp ] ; then
XRDB -merge $sysresources
else
XRDB -nocpp -merge $sysresources
fi
#else
XRDB -merge $sysresources
#endif
fi
if [ -f $sysmodmap ]; then
XMODMAP $sysmodmap
fi
2008-06-18 14:31:51 -06:00
if [ -f "$userresources" ]; then
#ifdef __APPLE__
if [ -x /usr/bin/cpp ] ; then
2008-06-18 14:31:51 -06:00
XRDB -merge "$userresources"
else
2008-06-18 14:31:51 -06:00
XRDB -nocpp -merge "$userresources"
fi
#else
2008-06-18 14:31:51 -06:00
XRDB -merge "$userresources"
#endif
fi
2008-06-18 14:31:51 -06:00
if [ -f "$usermodmap" ]; then
XMODMAP "$usermodmap"
fi
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
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
XCOMM start some nice programs
XCLOCK -geometry 50x50-1+1 &
XCONSOLE -iconic &
XTERM -geometry 80x24 &
WM || XTERM
if [ "$SSH_AGENT_PID" ]; then
ssh-add -D < /dev/null
eval `ssh-agent -s -k`
fi