Can I rename Librespot (Spotify)?

Hey. First timer here with balena and lovin’ it so far. One question. I notice on Spotify that my device comes up as…

image

And that librespot’s config is set to…

# Set the device broadcast name for Spotify
if [[ -z "$DEVICE_NAME" ]]; then
  DEVICE_NAME=$(printf "balenaSound Spotify %s" $(hostname | cut -c -4))
fi

Any idea on how I can change this? I’d like Spotify to show BLUETOOTH_DEVICE_NAME so as to control both displays with a single var.

Thanks.

Hi there – welcome to the forums! Glad to hear you’re enjoying things.

Taking a look at the code, I think that the only place I can find the variable BLUETOOTH_DEVICE_NAME being used is in bluetooth-audio/start.sh:

if [[ -z "$DEVICE_NAME" ]]; then
   if [[ "$BLUETOOTH_DEVICE_NAME" ]]; then
     DEVICE_NAME="$BLUETOOTH_DEVICE_NAME"
   else
     DEVICE_NAME=$(printf "balenaSound %s" $(hostname | cut -c -4))
   fi
fi

If I understand correctly, then, setting the DEVICE_NAME environment variable should take care of both of those things at once. Can you give that a try and let us know if it works?

All the best,
Hugh

Brilliant! Thanks.

image