mirror of https://gitlab.com/ceda_ei/wish
Source config file. Add WISH_CONFIG_FILE array for paths of config files.
This commit is contained in:
parent
9a2d831432
commit
186675ae4e
18
wish.sh
18
wish.sh
|
@ -10,10 +10,26 @@ function wish_print_right_prompt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function wish_init() {
|
function wish_init() {
|
||||||
|
# Find default config file if WISH_CONFIG_FILE is unset
|
||||||
|
if [[ ! -v WISH_CONFIG_FILE ]]; then
|
||||||
|
for path in "$XDG_CONFIG_HOME" "/usr/share" "$HOME/.config"; do
|
||||||
|
if [[ -f "$path/wish/config.gie" ]]; then
|
||||||
|
WISH_CONFIG_FILE="$path/wish/config.gie"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
# Source config files
|
||||||
|
for path in "$XDG_CONFIG_HOME" "/usr/share" "$HOME/.config"; do
|
||||||
|
if [[ -f "$path/wish/wish.py" ]]; then
|
||||||
|
source <($path/wish/wish.py ${WISH_CONFIG_FILE[@]})
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Source all plugins
|
# Source all plugins
|
||||||
local plugin
|
local plugin
|
||||||
local path
|
local path
|
||||||
for plugin in ${WISH_PLUGINS[@]} ${WISH_RIGHT_PLUGINS[@]}; do
|
for plugin in ${WISH_PLUGINS_SOURCE[@]}; do
|
||||||
for path in "$XDG_CONFIG_HOME" "/usr/share" "$HOME/.config"; do
|
for path in "$XDG_CONFIG_HOME" "/usr/share" "$HOME/.config"; do
|
||||||
source "$path/wish/plugins/$plugin.sh" &> /dev/null && break
|
source "$path/wish/plugins/$plugin.sh" &> /dev/null && break
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue