^ Programs & Scripts

🎧 playerctl_systray

Minimal System Tray Applet for Media Controls

This is just a simple and minimal system tray applet I created for my Linux setup while I was listening to music and working on a few side projects. I found myself getting annoyed by having to switch between workspaces/tags just to skip a track, so I decided to write a quick and janky Python applet. It saves me a few keystrokes and clicks in my everyday workflow. That’s really it πŸ˜…. I just wanted to share this in case anyone else wants to use this. It should work well with standalone window managers if you’re looking for a simple applet to get up and running without the need to write a widget or panel block.

Image of the systray applet

Technical Information:

The application creates a system tray icon using the AppIndicator3 library, which is a part of the GTK project (this should make it compatible with various Linux panels that support AppIndicators). It utilizes the playerctl command-line tool, making it work with most media players and web applications that supports MPRIS (Media Player Remote Interfacing Specification).

Dependencies:

Ubuntu/Debian

sudo apt update
sudo apt install gir1.2-appindicator3-0.1 playerctl

Fedora

sudo dnf install libappindicator-gtk3 playerctl

Arch Linux

sudo pacman -S libappindicator-gtk3 playerctl

UPDATE (06/26/2024): Found a Better Implementation!

I discovered a more complete implementation from Xaymup on GitHub @ media-control-indicator. Their version is more complete and retrieves the current track’s album art, prominent color, and it even updates the applet icon based on the application’s current state (paused/unpaused etc.). I personally recommend just using their implementation unless you specifically need to save a few kilobytes of RAM and disk space with my incomplete version πŸ˜…. Xaymup’s applet is also in the Arch User Repistory.

Their version requires the following additional dependencies: