Skip to content

Commit

Permalink
properly check for user config
Browse files Browse the repository at this point in the history
  • Loading branch information
carnager committed Aug 30, 2016
1 parent 890f25c commit 72e4071
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions buku_run
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,29 @@ actions="Alt+a"
help_color="#334433"

# source global config
source /etc/buku.config
if [[ -f /etc/buku_run.config ]]
then
source /etc/buku_run.config
fi

# source local config:
source $HOME/.config/buku_run/config
if [[ -z $XDG_CONFIG_DIR ]]
then
if [[ -f $HOME/.config/buku_run/config ]]
then
source $HOME/.config/buku_run/config
else
echo "User config file \'~/.config/buku_run/config\' not found. using global config"
fi
else
if [[ -f "${XDG_CONFIG_DIR}/buku_run/config" ]]
then
source "${XDG_CONFIG_DIR}/buku_run/config"
else
echo "User config file \'~/.config/buku_run/config\' not found. using global config"
fi
fi


main () {
HELP="Welcome to Buku. Use <span color='${help_color}'>${new_bookmark}</span> to add a new Bookmark
Expand Down

0 comments on commit 72e4071

Please sign in to comment.