mirror of
https://github.com/liclac/ambient
synced 2024-11-22 03:43:19 +00:00
bitbar: Fix config lookup
This commit is contained in:
parent
6ed62b1d9b
commit
912b0f37c5
1 changed files with 6 additions and 6 deletions
|
@ -11,15 +11,15 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
|||
PATH="/usr/local/bin:$PATH" # to find Homebrew-installed fish
|
||||
|
||||
# look for config file in XDG config dirs
|
||||
printf '%s:\0' "${XDG_CONFIG_HOME:-"${HOME}/.config"}:${XDG_CONFIG_DIRS:-/etc/xdg}" | while IFS=: read -d: -r p; do
|
||||
if [ -z "$config_file" ] && [ -r "$p/bitbar/plugins/ambient.json" ]; then
|
||||
config_file="$p/bitbar/plugins/ambient.json"
|
||||
while IFS=: read -d: -r p; do
|
||||
if [ -z "$config_path" ] && [ -r "$p/bitbar/plugins/ambient.json" ]; then
|
||||
config_path="$p/bitbar/plugins/ambient.json"
|
||||
fi
|
||||
done
|
||||
if [ -z "$config_file" ]; then
|
||||
done <<<$(printf '%s:\0' "${XDG_CONFIG_HOME:-"${HOME}/.config"}:${XDG_CONFIG_DIRS:-/etc/xdg}")
|
||||
if [ -z "$config_path" ]; then
|
||||
config='{}'
|
||||
else
|
||||
config="$(cat "$config_file")"
|
||||
config="$(cat "$config_path")"
|
||||
fi
|
||||
|
||||
WIDGET=$(/usr/local/bin/fish $DIR/../ambient-widgets | tr '\n' ' ')
|
||||
|
|
Loading…
Reference in a new issue