Added verbose messages for confog sourcing

This commit is contained in:
Dylan Araps 2016-08-12 11:25:59 +10:00
parent 7480d5c30d
commit 1b336f912e

View file

@ -2540,11 +2540,11 @@ getdefaultconfig 2>/dev/null
# Source Config {{{
# Check for $config_file first
getconfig () {
# Check $config_file
if [ -f "$config_file" ]; then
source "$config_file"
err "Sourced user config ($config_file)"
return
fi
mkdir -p "$XDG_CONFIG_HOME/neofetch/"
@ -2552,22 +2552,25 @@ getconfig () {
# Check $XDG_CONFIG_HOME/neofetch and create the
# dir/files if they don't exist.
if [ -f "$XDG_CONFIG_HOME/neofetch/config" ]; then
source "$XDG_CONFIG_HOME/neofetch/config"
config_file="$XDG_CONFIG_HOME/neofetch/config"
elif [ -f "/usr/share/neofetch/config" ]; then
cp "/usr/share/neofetch/config" "$XDG_CONFIG_HOME/neofetch"
source "$XDG_CONFIG_HOME/neofetch/config"
config_file="$XDG_CONFIG_HOME/neofetch/config"
elif [ -f "/usr/local/share/neofetch/config" ]; then
cp "/usr/local/share/neofetch/config" "$XDG_CONFIG_HOME/neofetch"
source "$XDG_CONFIG_HOME/neofetch/config"
config_file="$XDG_CONFIG_HOME/neofetch/config"
else
getscriptdir
cp "$script_dir/config/config" "$XDG_CONFIG_HOME/neofetch"
source "$XDG_CONFIG_HOME/neofetch/config"
config_file="$XDG_CONFIG_HOME/neofetch/config"
fi
source "$config_file"
err "Sourced user config ($config_file)"
}
# Check the commandline flags early for '--config none/off'