waybar_media_display

Crates.iowaybar_media_display
lib.rswaybar_media_display
version1.0.5
sourcesrc
created_at2022-07-29 04:04:08.495813
updated_at2022-07-31 05:03:34.189188
descriptionWaybar Media Display Module using playerctl
homepage
repositoryhttps://github.com/MichaelPetersen22/waybar_modules.git
max_upload_size
id634821
size12,062
Michael Petersen (Kruziikrel13)

documentation

README

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

Commit count: 0

cargo fmt