2017-02-07 16:16:45 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-09-25 14:19:35 -05:00
|
|
|
ENV_TYPE="${1}"
|
|
|
|
|
2019-03-13 07:36:53 -05:00
|
|
|
if [[ "$ENV_TYPE" = "auto" ]]; then
|
|
|
|
if [[ "$(xrandr --listmonitors | grep 'Monitors:' | awk '{print $2}')" -gt 1 ]]; then
|
|
|
|
ENV_TYPE="lodpi"
|
2019-03-13 22:12:37 -05:00
|
|
|
else
|
|
|
|
ENV_TYPE=""
|
2019-03-13 07:36:53 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-09-25 14:19:35 -05:00
|
|
|
if [[ -z "$ENV_TYPE" ]]; then
|
|
|
|
ENV_TYPE=""
|
|
|
|
else
|
2019-10-30 08:52:55 -05:00
|
|
|
ENV_TYPE="${ENV_TYPE}-"
|
2018-09-25 14:19:35 -05:00
|
|
|
fi
|
|
|
|
|
2017-02-08 11:54:30 -06:00
|
|
|
sysresources="/etc/X11/xinit/.Xresources"
|
|
|
|
sysmodmap="/etc/X11/xinit/.Xmodmap"
|
2017-02-07 16:16:45 -06:00
|
|
|
userresources="$HOME/.Xresources"
|
2019-12-02 09:31:28 -06:00
|
|
|
usercolors="$DOTFILES_PATH/bin/lib/colors/xresources"
|
2019-10-30 08:52:55 -05:00
|
|
|
userenv="$EDFP/x/${ENV_TYPE}resources"
|
|
|
|
usermodmap="$EDFP/x/modmap"
|
2019-03-13 22:12:37 -05:00
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
if [ -f "$sysresources" ]; then
|
|
|
|
xrdb -merge "$sysresources" >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$sysmodmap" ]; then
|
|
|
|
xmodmap "$sysmodmap" >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$userresources" ]; then
|
|
|
|
xrdb -merge "$userresources" >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$usercolors" ]; then
|
|
|
|
xrdb -merge "$usercolors" >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$userenv" ]; then
|
|
|
|
xrdb -merge "$userenv" >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$usermodmap" ]; then
|
|
|
|
xmodmap "$usermodmap" >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "/etc/X11/xinit/xinitrc.d" ] ; then
|
2018-10-31 14:40:57 -05:00
|
|
|
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
2017-02-07 16:16:45 -06:00
|
|
|
[ -x "$f" ] && . "$f"
|
|
|
|
done
|
|
|
|
unset f
|
|
|
|
fi
|
|
|
|
|