#!/bin/sh

[ -f ${HOME}/.profile ] && . ${HOME}/.profile

userresources=${HOME}/.Xresources
usermodmap=${HOME}/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

if [ -f ${sysresources} ]; then
    xrdb -merge ${sysresources}
fi

if [ -f ${sysmodmap} ]; then
    xmodmap ${sysmodmap}
fi

if [ -f "${userresources}" ]; then
    xrdb -merge "${userresources}"
fi

if [ -f "${usermodmap}" ]; then
    xmodmap "${usermodmap}"
fi

# update environment used for D-Bus session services
dbus-update-activation-environment --all

eval "${@}"
exit
