# Can I rename Librespot (Spotify)?

**URL:** <https://forums.balena.io/t/can-i-rename-librespot-spotify/150987>\
**Category:** balenaOS\
**Created:** [July 6, 2020, 6:44pm UTC](https://forums.balena.io/t/can-i-rename-librespot-spotify/150987 "2020-07-06T18:44:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![svenio](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@svenio](https://forums.balena.io/u/svenio)\
**Post date:** [July 6, 2020, 6:44pm UTC](https://forums.balena.io/t/can-i-rename-librespot-spotify/150987/1 "2020-07-06T18:44:07Z")

</div>

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

![image](https://global.discourse-cdn.com/balena/original/2X/2/215850cf372a44e884ad13b22df92d965898b394.png)

And that librespot’s [config](https://github.com/balenalabs/balena-sound/blob/master/spotify/start.sh) 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.

---

<div class="post-metadata">

**Author:** ![saintaardvark](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/saintaardvark/32/3390_2.png) [@saintaardvark](https://forums.balena.io/u/saintaardvark)\
**Post date:** [July 6, 2020, 7:38pm UTC](https://forums.balena.io/t/can-i-rename-librespot-spotify/150987/4 "2020-07-06T19:38:15Z")

</div>

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](https://github.com/balenalabs/balena-sound/blob/master/bluetooth-audio/start.sh#L13-L19):

```auto
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](https://sound.balenalabs.io/docs/customizations/#change-device-name) 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

---

<div class="post-metadata">

**Author:** ![svenio](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@svenio](https://forums.balena.io/u/svenio)\
**Post date:** [July 6, 2020, 8:38pm UTC](https://forums.balena.io/t/can-i-rename-librespot-spotify/150987/6 "2020-07-06T20:38:40Z")

</div>

Brilliant! Thanks.

![image](https://global.discourse-cdn.com/balena/original/2X/9/9a75c4545b9759b075f8d39049f866dc2d920f3a.png)
