Skip to content

Commit 1966ac6

Browse files
sstarkserl
andauthored
Use .local/state/syncthing (#17)
* Use .local/state/syncthing If SYNCTHING_CONFIG_FILE is not set and default config not found, look for config.xml in localstate directory: SYNCTHING_DEFAULT_STATEDIR="$HOME/.local/state/syncthing" At least in my environment (manjaro linux) this is where a working config.xml is located by default. * Make sure `SYNCTHING_CONFIG_FILE` is never empty --------- Co-authored-by: Sergio Livi <me@serl.it>
1 parent a1c778e commit 1966ac6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

syncthing-quick-status.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ done
1515

1616
if [[ -z $SYNCTHING_API_KEY ]]; then
1717
SYNCTHING_DEFAULT_CONFIG_FILE="$HOME/.config/syncthing/config.xml"
18+
if [[ ! -r "$SYNCTHING_DEFAULT_CONFIG_FILE" ]]; then
19+
SYNCTHING_DEFAULT_CONFIG_FILE="$HOME/.local/state/syncthing/config.xml"
20+
fi
1821
if [[ $(uname) = Darwin ]]; then
19-
# config.xml is stored in a different path in MacOS:
2022
SYNCTHING_DEFAULT_CONFIG_FILE="$HOME/Library/Application Support/Syncthing/config.xml"
2123
fi
2224
: "${SYNCTHING_CONFIG_FILE:="$SYNCTHING_DEFAULT_CONFIG_FILE"}"

0 commit comments

Comments
 (0)