mirror of
https://github.com/liclac/ambient
synced 2025-02-16 12:28:24 +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
|
PATH="/usr/local/bin:$PATH" # to find Homebrew-installed fish
|
||||||
|
|
||||||
# look for config file in XDG config dirs
|
# 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
|
while IFS=: read -d: -r p; do
|
||||||
if [ -z "$config_file" ] && [ -r "$p/bitbar/plugins/ambient.json" ]; then
|
if [ -z "$config_path" ] && [ -r "$p/bitbar/plugins/ambient.json" ]; then
|
||||||
config_file="$p/bitbar/plugins/ambient.json"
|
config_path="$p/bitbar/plugins/ambient.json"
|
||||||
fi
|
fi
|
||||||
done
|
done <<<$(printf '%s:\0' "${XDG_CONFIG_HOME:-"${HOME}/.config"}:${XDG_CONFIG_DIRS:-/etc/xdg}")
|
||||||
if [ -z "$config_file" ]; then
|
if [ -z "$config_path" ]; then
|
||||||
config='{}'
|
config='{}'
|
||||||
else
|
else
|
||||||
config="$(cat "$config_file")"
|
config="$(cat "$config_path")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WIDGET=$(/usr/local/bin/fish $DIR/../ambient-widgets | tr '\n' ' ')
|
WIDGET=$(/usr/local/bin/fish $DIR/../ambient-widgets | tr '\n' ' ')
|
||||||
|
|
Loading…
Add table
Reference in a new issue