17 March 2018 | 3 min read

Linux - Minimize Spotify to taskbar

Spotify

Hey, the last time I using Spotify was around a years ago on my previous company desktop workstation running Ubuntu 16.06 (As far I remember). Today I installing Spotify to my Fedora 27. Seem minimize to tray when close windows options are completely missing (Last time it have, but need to configure) from Spotify setting.

I don’t like it work like now.. messy. So as workaround, let use kdocker to dock Spotify to tray. It available for most distro too (Fedora, Arch, Ubuntu, Debian).

Here some infomation from Fedora repo :

$ dnf info kdocker
Installed Packages
Name         : kdocker
Version      : 5.0
Release      : 8.fc27
Arch         : x86_64
Size         : 208 k
Source       : kdocker-5.0-8.fc27.src.rpm
Repo         : @System
From repo    : fedora
Summary      : Dock any application in the system tray
URL          : https://github.com/user-none/KDocker
License      : GPLv2+
Description  : KDocker will help you dock any application in the system tray. This means you
             : can dock OpenOffice, XMMS, Firefox, Thunderbolt, Eclipse, anything! Just point
             : and click. Works for LXQT/KDE and GTK/GNOME (In fact it should work for most
             : modern window managers that support NET WM Specification for instance).
             : 
             : All you need to do is start KDocker and select an application using the mouse
             : and lo! the application gets docked into the system tray. The application can
             : also be made to disappear from the task bar.

To install kdocker with Fedora just run these command

$ sudo dnf install kdocker -y

or if you using Ubuntu / Debian

$ sudo apt-get install kdocker -y

Now edit file /usr/share/applications/spotify.desktop and change the Exec :

Exec=kdocker -q -o -l -i /usr/share/icons/Papirus/64x64/apps/spotify.svg spotify %U

Below is my full spotify.desktop file, please take note you need to change /usr/share/icons/Papirus/64x64/apps/spotify.svg with you own path to Spotify icon :

[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Spotify streaming music client
Icon=spotify-client
Exec=kdocker -q -o -l -i /usr/share/icons/Papirus/64x64/apps/spotify.svg spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Audio;Music;Player;AudioVideo;
MimeType=x-scheme-handler/spotify;

Now close instance of Spotify if already open and launch again via menu then you will notice spotify automatically minimize to taskbar. Double click on icon and kdocker will open spotify windows menu for you and minimize again if you done or click minimize.

Nice! That all, see you next round ~

Robbi Nespu | Fedora, Linux, Spotify


Discussion and feedback