dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 9c4ec1b4860872ae2c6a1851218955b28a9950ea
parent 11a10a9cbbed843d2ee697cd65066e1fe54e69a1
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri, 19 Jan 2018 08:18:37 -0500

xsession enhancements

1. Use xsetroot to set background color
2. Call .fehbg if it exists
3. Detect "custom" sessions, select window manager, and call exec
4. Check for fbautostart if dex doesn't exist
5. Configure natural (reverse) mouse scrolling

Diffstat:
M.xsession | 35+++++++++++++++++++++++++++++++----
1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/.xsession b/.xsession @@ -4,24 +4,51 @@ # [ -n "$DISPLAY" ] && echo "$DISPLAY" > "$HOME/.xdisplay" +[ -f "$HOME/.xdisplay" ] && chmod 600 "$HOME/.xdisplay" xset dpms 0 0 300 +[ -r "$HOME/.Xmouse" ] && xmodmap .Xmouse -# Terminals spawned within X should start at SHLVL=1 SHLVL=0; export SHLVL +xsetroot -solid "#444444" +[ -x "$HOME/.fehbg" ] && "$HOME/.fehbg" + if [ -d /usr/share/fonts/noto/ ] then xset fp+ /usr/share/fonts/noto/ xset fp rehash fi +if [ $# -eq 0 ] +then + for wm in awesome i3 twm + do + if type $wm > /dev/null 2>&1 + then + set -- $wm + EXEC=1 + break + fi + done +fi + if type dex > /dev/null 2>&1 then - : ${XDG_CURRENT_DESKTOP:=$XDG_SESSION_DESKTOP} + AUTOSTART_CMD='dex -ae $XDG_CURRENT_DESKTOP' +elif type fbautostart > /dev/null 2>&1 +then + AUTOSTART_CMD="fbautostart" +fi + +if [ -n "$AUTOSTART_CMD" ] +then + : ${XDG_CURRENT_DESKTOP:=${XDG_SESSION_DESKTOP:-$1}} case $XDG_CURRENT_DESKTOP in - awesome|twm) - dex -ae $XDG_CURRENT_DESKTOP + awesome|i3|twm) + $AUTOSTART_CMD ;; esac fi + +[ -n $EXEC ] && exec $@