A scrolling MPRIS module for Waybar written in Rust.
Note: This project was generated and improved with the help of AI.
- DBus: Required for inter-process communication.
- playerctl: Ensure this daemon is running for MPRIS control.
- Cargo: Rust's package manager and build tool (Learn more).
- Clone the Repository:
git clone https://github.com/BEST8OY/ScrollMPRIS.git cd ScrollMPRIS
- Build the Project:
cargo build --release
- Locate the Executable:
After a successful build, the binary will be in:
ScrollMPRIS/target/release/
To add ScrollMPRIS as a custom module in Waybar, insert the following snippet into your Waybar config:
"custom/ScrollMPRIS": {
"return-type": "json",
"exec": "/path/to/ScrollMPRIS",
"escape": true,
"on-click": "playerctl play-pause"
},
Replace /path/to/ScrollMPRIS
with the actual path to your built binary.
You can customize the module's appearance using these selectors in your Waybar style:
#custom-ScrollMPRIS,
#custom-ScrollMPRIS.playing,
#custom-ScrollMPRIS.paused,
ScrollMPRIS offers several command-line options to tailor its behavior:
Option | Description | Example |
---|---|---|
-s , --speed <0-100> |
Scroll speed (0: slow=1000ms, 100: fast=100ms) | -s 50 |
-w , --width <number> |
Maximum width for the scrolling text | -w 40 |
-b , --blocked <list> |
Block certain players (comma-separated, case-insensitive) | -b edge,firefox,mpv |
-p , --position |
Enable position display (show track time info) | -p or --position |
--scroll <wrapping OR reset> |
Choose scrolling behavior: wrapping for continuous loop, reset to restart after finish |
--scroll wrapping |
--position-mode <mode> |
Position style: increasing (elapsed) or remaining (time left) |
--position-mode remaining |
--format <string> |
Metadata format (supports {title} , {artist} , {album} ) |
--format '{title} - {artist}' |
--no-icon |
Disable icon in output | --no-icon |
--freeze |
Pause scroll when playback is paused | --freeze |
Examples:
./ScrollMPRIS -s 50 -w 40 -b edge,firefox,mpv --scroll wrapping --position --position-mode remaining --format '{title} - {artist}' --no-icon
- To enable position display, simply add
-p
or--position
(no value needed). - To disable, omit the flag.
Reset mode:
Wrapped mode:
Contributions, feature requests, and issue reports are always welcome! Feel free to open an issue or submit a pull request.
- ScrollMPRIS and this README were written and improved using AI.
Unlicensed. See LICENSE for details.