From 7619f71549242a65bcf876c9cb453f2fddafacc4 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 28 Jan 2016 11:55:43 +1100 Subject: [PATCH] Added support for '$XINITRC' to getwindowmanager --- fetch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fetch b/fetch index 2e432bfd..ae1b162a 100755 --- a/fetch +++ b/fetch @@ -600,11 +600,11 @@ getwindowmanager () { elif [ "$XDG_CURRENT_DESKTOP" ]; then windowmanager="$XDG_CURRENT_DESKTOP" + elif [ "$XINITRC" ]; then + windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc") + elif [ -e "$HOME/.xinitrc" ]; then - xinitrc=$(grep "^[^#]*exec" "${HOME}/.xinitrc") - windowmanager="${xinitrc/exec }" - windowmanager="${windowmanager/-session}" - windowmanager="${windowmanager^}" + windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc") else case "$os" in @@ -622,6 +622,10 @@ getwindowmanager () { esac fi + + windowmanager="${windowmanager/exec }" + windowmanager="${windowmanager/-session}" + windowmanager="${windowmanager^}" } # }}}