diff --git a/spotify b/spotify index ac77b55..981bdb4 100755 --- a/spotify +++ b/spotify @@ -27,8 +27,13 @@ # SOFTWARE. USER_CONFIG_DEFAULTS="CLIENT_ID=\"\"\nCLIENT_SECRET=\"\""; -USER_CONFIG_FILE="${HOME}/.shpotify.cfg"; -if ! [[ -f "${USER_CONFIG_FILE}" ]]; then + +if [[ -f "${HOME}/.shpotify.cfg" ]]; then + USER_CONFIG_FILE="${HOME}/.shpotify.cfg"; +else + DIR_CONFIG_FILE="${XDG_CONFIG_HOME:-${HOME}/.config}/shpotify" + mkdir -p "${DIR_CONFIG_FILE}" + USER_CONFIG_FILE="${DIR_CONFIG_FILE}/shpotify.cfg" touch "${USER_CONFIG_FILE}"; echo -e "${USER_CONFIG_DEFAULTS}" > "${USER_CONFIG_FILE}"; fi