summarylogtreecommitdiffstats
path: root/spotify.sh
blob: 8ee5f63fa95323f5eb62a3025dae636bd83eb755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

# Substitute XDG_CONFIG_HOME by ~/.config if the env var is unset or empty
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}

# Allow users to override command-line options
if [[ -f "${XDG_CONFIG_HOME}/spotify-flags.conf" ]]; then
    SPOTIFY_USER_FLAGS="$(grep -v '^#' "${XDG_CONFIG_HOME}/spotify-flags.conf")"
    echo "User flags: ${SPOTIFY_USER_FLAGS}"
fi

# Launch Spotify
exec /opt/spotify/spotify "${SPOTIFY_USER_FLAGS}" "${@}"