12.6 C
Jaipur
Saturday, January 22, 2022

Set The Currently Playing Spotify Song Title And Album Cover As Your GNOME Wallpaper With This Script

Must read

Blueberry is a new Python scripts that sets your currently playing Spotify song title and album cover as your GNOME desktop wallpaper. To use it, you need Spotify Premium.

The wallpaper includes the album cover in the center, while also using the 2 main colors from the cover to paint the rest of the wallpaper. The artist and song title are also displayed on the wallpaper.

The script changes your background to the currently playing Spotify song album cover and song title, no matter how you listen to music on Spotify. You can use the native desktop app, the Spotify snap or flatpak packages, Spotify web, using some other desktop Spotify clients, and even Spotify running on your phone.

For authentication, the script requires creating a developer app, and using its client id and secret.

This Blueberry Python script does have a pretty important downside, though. You need to run it while a song is already playing on your Spotify account. If you run it while no song is playing, it will show an error and exit, so that means you can’t add to startup, for example (it doesn’t stop if you pause a song though). Hopefully this will be fixed by its developer.

It’s also worth noting that Blueberry changes the wallpaper using the gsettings set org.gnome.desktop.background picture-uri command, so it should work on any GNOME-based desktop that supports this, and not just GNOME (it didn’t work with Cinnamon for me though, I’m not sure why). Also, if you use some other desktop environment, you could change this command to one that works for your desktop – the command is near the bottom in the main.py file.

I’m also not sure how this works with multiple monitors, as I’m currently using a laptop with no external monitors.

You might also like: Embed An Audio Visualizer On Your Linux Desktop Background Using GLava

Here are 2 more screenshots of desktop backgrounds generated by Blueberry:

How to run Blueberry Python script to set your GNOME desktop wallpaper to the currently playing Spotify song title and album cover

1. To use Blueberry to change your desktop wallpaper to the currently playing Spotify song, start by installing git (to get the source from GitHub) and python3-pip (to install the script dependencies):

  • Debian, Ubuntu, Pop!_OS, etc.:

sudo apt install python3-pip git
sudo dnf install python3-pip git
sudo pacman -S python-pip git

sudo zypper install python3-pip git

2. Use pip3 to install the Blueberry dependencies:

python3 -m pip install --user --upgrade colorgram.py spotipy pillow

3. Next, get the latest Blueberry script code from GitHub (and also create the ImageCache folder inside the Blueberry directory, or else we’ll get an error later on):

git clone https://github.com/newpolygons/Blueberry

mkdir Blueberry/ImageCache

4. Now we’ll need to create a new Spotify (requires a premium account) app. Go to https://developer.spotify.com/dashboard/applications, login with your Spotify account and click on CREATE AN APP. Pick an App name and App description of your choice, and click the CREATE button to create your application.

Once your application has been created, click on the green EDIT SETTINGS button (top-right) and add a new Redirect URI set to https://www.google.com/, then click the Save button (at the bottom).

Now on your new application page, you should see the Client ID, as well as a link that say SHOW CLIENT SECRET which displays your client secret. Copy the Client ID and Client Secret codes to the corresponding fields in the creds.txt file inside the Blueberry folder.

In this creds.txt file, you’ll also need to fill in your Spotify username. You can see your username by going to https://www.spotify.com/account/overview/ and logging in with your Spotify account.

Also in the creds.txt file, change the display_size value to your display size. Remember to save the file when you’re done.

5. Let’s authenticate Blueberry with your Spotify account.

Open a terminal and navigate to the Blueberry folder, e.g.:

cd Blueberry

There, run:

python3 main.py

After running this command, a new tab will open in your default web browser. Login there to Spotify if you weren’t already logged in, and then you’ll be redirected to https://www.google.com/ followed by ?code= and a long code. Copy the entire URL back to the terminal where you ran the python3 main.py command, and press Enter.

After this, if you didn’t already have Spotify playing a song, you’ll get an error message: “Error: looks like no song is playing“. That’s because, like I mentioned above, the Blueberry script exists if it’s ran when no Spotify song is playing. So open Spotify (desktop client, web client, on your mobile device, etc., it doesn’t matter), start playing a song, then run Blueberry again using (run the command in the Blueberry folder):

python3 main.py

Your GNOME desktop background should now change to the song that’s currently playing in your Spotify client.

Tip: If you have a dock on the left-hand side of the monitor, and the currently playing song title gets behind the dock, open the main.py script from inside the Blueberry folder with a text editor, and change the 50 value from titleArtist.text((50 to something like 100 (you can try different values to see which best suits your needs).

Related:

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -

Latest article