dotfiles

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

commit 4e3bc25050695218a1232b1fb56a4639ad81d679
parent 296dfc01e57fff909f2febfc0906c4bc84502871
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Tue,  7 Jan 2020 05:58:04 -0500

xsession: Use drop-in files instead of XDG autostart

Diffstat:
M.xsession | 37++++---------------------------------
Aetc/xsession.d/autorandr.sh | 3+++
Aetc/xsession.d/browser.sh | 8++++++++
Aetc/xsession.d/dunst.sh | 3+++
Aetc/xsession.d/dwmstatus.sh | 3+++
Aetc/xsession.d/redshift.sh | 3+++
Aetc/xsession.d/xbindkeys.sh | 3+++
7 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/.xsession b/.xsession @@ -4,35 +4,9 @@ # echo "Running $HOME/.xsession as PID $$" >&2 [ -r "$HOME/.Xresources.local" ] && xrdb -merge "$HOME/.Xresources.local" -[ -r "$HOME/.xsession.local" ] && . "$HOME/.xsession.local" date +'%m/%d/%Y %H:%M:%S' >&2 env >&2 -__autostart() -{ - if type dex > /dev/null 2>&1 - then - AUTOSTART_CMD="dex -ae $1" - elif type fbautostart > /dev/null 2>&1 - then - FBXDG_DE=$1 - AUTOSTART_CMD="fbautostart" - fi - - until ps -U $LOGNAME | grep $1 > /dev/null 2>&1 - do - sleep 1 - done - - if [ -n "$AUTOSTART_CMD" ] - then - echo "Running autostart command: $AUTOSTART_CMD" >&2 - $AUTOSTART_CMD >&2 - else - xbindkeys >&2 - fi -} - xset dpms 0 0 900 s 300 0 SHLVL=0; export SHLVL @@ -53,12 +27,9 @@ then done fi -case $1 in - start*|*session) ;; - *) - __autostart "$@" & - ;; -esac +for file in "$HOME"/etc/xsession.d/*.sh +do + [ -r $file ] && . $file +done -unset __autostart exec "$@" diff --git a/etc/xsession.d/autorandr.sh b/etc/xsession.d/autorandr.sh @@ -0,0 +1,2 @@ +type autorandr > /dev/null 2>&1 || return +autorandr -c --default default+ \ No newline at end of file diff --git a/etc/xsession.d/browser.sh b/etc/xsession.d/browser.sh @@ -0,0 +1,7 @@ +if type surf > /dev/null 2>&1 +then + BROWSER=surf +else + BROWSER=firefox +fi +export BROWSER+ \ No newline at end of file diff --git a/etc/xsession.d/dunst.sh b/etc/xsession.d/dunst.sh @@ -0,0 +1,3 @@ +type dunst >/dev/null 2>&1 || return +[ "$1" = "dwm" ] || return +dunst & diff --git a/etc/xsession.d/dwmstatus.sh b/etc/xsession.d/dwmstatus.sh @@ -0,0 +1,3 @@ +type dwmstatus > /dev/null 2>&1 || return +[ "$1" = "dwm" ] || return +dwmstatus & diff --git a/etc/xsession.d/redshift.sh b/etc/xsession.d/redshift.sh @@ -0,0 +1,2 @@ +type redshift > /dev/null 2>&1 || return +redshift &+ \ No newline at end of file diff --git a/etc/xsession.d/xbindkeys.sh b/etc/xsession.d/xbindkeys.sh @@ -0,0 +1,2 @@ +type xbindkeys > /dev/null 2>&1 || return +xbindkeys+ \ No newline at end of file