Categories: Ubuntu

Show Spotify Playback Info in Top-bar in Ubuntu 24.04

Spotify users? Here’s an extension that can display the current track information in Ubuntu top-bar.

It’s spotify-tray, a free open-source tool available as GNOME Shell Extension, that can show title, artist, and/or album of current playing song or podcast in top-panel.

The extension is very simple and customizable. You can control:

  • Where (left, center, or right) to display the playback info in top-bar.
  • What to display, including track, artist, album, custom text, emoji (via built-in selector).
  • Display in static mode, or horizontally scrolling marquee.

It uses Spotify’s exposed dbus interface to fetch metadata rather than the web API, and works with Spotify app installed as Snap, Flatpak, and Deb packages.

So far, the extension supports GNOME version from 3.36 to 46. Meaning it works on Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04, and other recent Linux, such as Debian 11/12, Fedora Workstation, Arch, RHEL 9 with GNOME Desktop.

Step 1: Install the Spotify-Tray Extension

For Ubuntu 22.04, and Ubuntu 24.04, first search for and install “Extension Manager” from either Ubuntu Software or App Center.

Install Extension Manager in Ubuntu Software/App Center

Then, you may use “Extension Manager” to search & install spotify tray extension under Browse tab. For Ubuntu 22.04, switch filter if it does not show you the correct search result.

For Ubuntu 20.04 and other Linux with GNOME, just go to the link page below:

Then use the ON/OFF toggle to install.

NOTE: You need to install browser extension (if prompted in the page) and refresh. Ubuntu user also need to press Ctrl+Alt+T to open terminal and run command to install the agent package:

sudo apt install chrome-gnome-shell

Step 2: Fix for GNOME 46 (Ubuntu 24.04)

At the moment of writing, the extension has an issue if you installed it on GNOME 46.

It’s disabled by default with a cross mark in Extension Manager (or GNOME Extensions app) page. By opening its preferences dialog will show you “Something’s gone wrong” with following technical details:

GLib.FileError: Failed to open file “/home/ji/.local/share/gnome-shell/extensions/[email protected]/prefs.xml”: No such file or directory

Stack trace:
getPreferencesWidget@file:///home/ji/.local/share/gnome-shell/extensions/[email protected]/prefs.js:78:17
fillPreferencesWindow@resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js:36:29
_loadPrefs@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:41:18
async*_init@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:26:14

To fix the issue, simply create the prefs.xml file manually under the extension folder, and paste the file content from the Github project page.

  • First, go to the project file page github.com/esenliyim/sp-tray/blob/master/prefs.xml, press Ctrl+A to select all and copy the file content.
  • Launch “Text Editor” and create an empty file, then paste the content into this file.
  • Finally, press Ctrl+Shift+S in text editor to open “Save As” dialog. Then do:
    • Set filename prefs.xml
    • Save to “.local/share/gnome-shell/extensions/extensions/[email protected]/” directory.

Press Ctrl+H to show/hide .local folder if you don’t see it. Finally, log out and back in to apply changes.

Step 3: Configure the Extension

If everything goes well, you can now launch “Extension Manager” or “Gnome Extensions” (both available in Ubuntu Software or App Center), and click the gear icon to launch the preferences dialog for the extension.

Finally, configure what to display on top-bar, position, display mode, and more.

When done, launch Spotify and play something to verify. Enjoy!

The post Show Spotify Playback Info in Top-bar in Ubuntu 24.04 appeared first on Osgrove.

Ubuntu Server Admin

Recent Posts

Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge

Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI…

4 hours ago

Welcome to the Ubuntu Weekly Newsletter 883

Welcome to the Ubuntu Weekly Newsletter, Issue 883 for the week of March 9 –…

2 days ago

How to Install nvidia-smi on Ubuntu or Debian Linux

In this article, we will see how to install nvidia-smi on Ubuntu or Debian Linux.…

2 days ago

How to Install clang tool on Ubuntu or Debian Linux

In this article, we will see how to install clang tool on Ubuntu or Debian…

3 days ago

How to resolve Ubuntu 20.04 Container Signature Errors on Raspberry Pi ARM Devices

When working with Docker containers on Raspberry Pi devices, you might encounter frustrating signature verification…

4 days ago

How to fix DNS Resolution Issues with OpenVPN on Ubuntu 18.04

You’ve recently upgraded to Ubuntu 18.04 and found that your OpenVPN connection no longer resolves…

4 days ago