diff --git a/README.md b/README.md index 7b25caa..1dee6e7 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Call ufw -h for help. Dependencies: curl, jq -The config goes into `$XDG_CONFIG_DIR/ufw`. +The config goes into `$XDG_CONFIG_HOME/ufw`. ufwd ---- diff --git a/ufw b/ufw index e06a883..6e4e4df 100755 --- a/ufw +++ b/ufw @@ -55,7 +55,7 @@ usage() { cfg_service_url Environment variables: - UFW_CFG_FILE # Config file to read, defaults to \$XDG_CONFIG_DIR/ufw + UFW_CFG_FILE # Config file to read, defaults to \$XDG_CONFIG_HOME/ufw UFW_SECRET # Your API secret UFW_TMP_DIR UFW_URL @@ -332,12 +332,12 @@ main() { XDG_RUNTIME_DIR="/run/user/$UID" fi - if ! [[ "$XDG_CONFIG_DIR" ]]; then - XDG_CONFIG_DIR="$HOME/.config" + if ! [[ "$XDG_CONFIG_HOME" ]]; then + XDG_CONFIG_HOME="$HOME/.config" fi cfg_url_regex='^[A-Za-z]([A-Za-z0-9+.-]+)?://.+' - cfg_file=${UFW_CFG_FILE:-"$XDG_CONFIG_DIR/ufw"} + cfg_file=${UFW_CFG_FILE:-"$XDG_CONFIG_HOME/ufw"} [[ $UFW_SECRET ]] && secret=$UFW_SECRET [[ $UFW_TMP_DIR ]] && cfg_tmp_dir=$UFW_TMP_DIR @@ -353,7 +353,7 @@ main() { fi # Defaults - : ${cfg_file:="$XDG_CONFIG_DIR/ufw"} + : ${cfg_file:="$XDG_CONFIG_HOME/ufw"} : ${cfg_tmp_dir:="$XDG_RUNTIME_DIR/ufw"} : ${cfg_service_url:='https://8fw.me'} : ${cfg_max_filesize:='200M'}