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