#media-player #waybar #module #display #icons #spotify #playerctl

app waybar_media_display

Waybar Media Display Module using playerctl

7 releases (stable)

1.0.5 Jul 31, 2022
1.0.4 Jul 30, 2022
0.1.0 Jul 29, 2022

#391 in Audio

GPL-3.0-or-later

6KB
69 lines

Waybar Media Display Module

Media Player Module

Installation

With Pre-Requisites already installed

cargo install waybar_media_display

Alternatively you can just run

curl https://raw.githubusercontent.com/MichaelPetersen22/waybar_modules/main/media_install.sh -sSf | sh

If you want to also install the font used with the default icon option (The spotify icon), run the below script

curl https://raw.githubusercontent.com/MichaelPetersen22/waybar_modules/main/media_install.sh| bash -s -- yes

Pre-Requisites

cargo

curl https://sh.rustup.rs -sSf | sh

playerctl

sudo pacman -S playerctl

otf-font-awesome

sudo pacman -S otf-font-awesome

Usage

The command is not intended to be used on it's own as it prints back a json for waybar to read and convert into the module.

Example usage in waybar config is included below

 "custom/spotify": {
 
       "interval": 1,
       
       "return-type": "json",
       
       "exec": "waybar_media_display",
       
       "exec-if": "pgrep spotify",
       
       "on-click":"playerctl --player=spotify play-pause",
 
       "escape": true
       
    }

Pay special attention to the "exec" field as that is where the module is called.

The example utilizes the defaults of the media display, however you can provide it with any media player supported by playerctl, and you can provide it any text or font that you wish for the icon. For my spotify icon I used otf-font-awesome

For details on how to use the command and the default values of the command, run waybar_media_display --help

Dependencies

~3MB
~59K SLoC