A simple C++ program which grabs mpris.MediaPlayer2
metadata through dBus and scrolls it on a window, created with the intention of being run with polybar.
There are similar projects from which I took inspiration from, namely jan146's playerctl-scroller and PrayagS's polybar-spotify, please check them out.
I did not create (yet) any installer for this. For now, simply clone this repository, compile it with g++
and run the binary file. It can be moved to whichever directory, such as ~/.config/polybar/scripts/
.
git clone https://github.com/diogofd8/dBusPlayerScroller.git
cd dbusStringScroller
make -f makefile all
# Copy the binary to your preferred directory
mkdir -p ~/.config/polybar/scripts/
cp dbusStringScroller ~/.config/polybar/
It can be launched from any custom/script
, such as:
[module/spotify]
type = custom/script
tail = true
format = <label>
exec = $HOME/.config/polybar/scripts/dbusStringScroller
While the default configuration (running the binary without extra arguments) is set to work with spotify
, dBusPlayerScroller
is meant to support any mpris.MediaPlayer2
compatible player. The configuration options are as follows:
dBusStringScroller [Options]
Options:
-p | --player [player name]
-s | --speed [scroll speed]
-l | --length [view length]
-d | --debug
Scroll speed is in millisseconds, length corresponds to the dimensions (in character count) of the viewer window. I plan to add a metadata formatting option and a prefix/suffix option to format the output to any taste!
git
gcc
dbus