From 4184c1750704b36277fec3691006a28c5a2b629c Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 1 Apr 2016 17:38:06 +1100 Subject: [PATCH] Better implementation of envar check --- neofetch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 7a61090d..f090b1ec 100755 --- a/neofetch +++ b/neofetch @@ -881,7 +881,7 @@ getwmtheme () { if [ -f "$kde_config_dir/share/config/kwinrc" ]; then wmtheme="$(awk '/PluginLib=kwin3_/{gsub(/PluginLib=kwin3_/,"",$0); print $0; exit}' "$kde_config_dir/share/config/kwinrc")" - elif [ -f "$KDE_CONFIG_DIR/share/config/kdebugrc" ]; then + elif [ -f "$kde_config_dir/share/config/kdebugrc" ]; then wmtheme="$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kde_config_dir/share/config/kdebugrc")" fi ;; @@ -2557,7 +2557,10 @@ cache () { # KDE Config directory {{{ kdeconfigdir () { - if type -p kde5-config >/dev/null 2>&1; then + if [ -n "$KDE_CONFIG_DIR" ]; then + kde_config_dir="$KDE_CONFIG_DIR" + + elif type -p kde5-config >/dev/null 2>&1; then kde_config_dir=$(kde5-config --localprefix) elif type -p kde4-config >/dev/null 2>&1; then