Skip to content

BEST8OY/ScrollMPRIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScrollMPRIS

A scrolling MPRIS module for Waybar written in Rust.

Note: This project was generated and improved with the help of AI.


Prerequisites

  • 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).

Installation & Build

Arch User Repository (AUR)

The program is now on Arch User Repository. You can an AUR helper like yay to install it.

yay -S scrollmpris-git

Manual

  1. Clone the Repository:

    git clone https://github.com/BEST8OY/ScrollMPRIS.git
    cd ScrollMPRIS
  2. Build the Project:

    cargo build --release
  3. Locate the Executable: After a successful build, the binary will be in:

    target/release/
  4. Install Install the binary to /usr/local/bin

    install -Dt /usr/local/bin target/release/ScrollMPRIS

Waybar Integration

To add ScrollMPRIS as a custom module in Waybar, insert the following snippet into your Waybar config:

"custom/ScrollMPRIS": {
    "return-type": "json",
    "exec": "ScrollMPRIS",
    "escape": true,
    "on-click": "playerctl play-pause"
},

Replace /path/to/ScrollMPRIS with the actual path to your built binary.

Styling with CSS

You can customize the module's appearance using these selectors in your Waybar style:

#custom-ScrollMPRIS,
#custom-ScrollMPRIS.playing,
#custom-ScrollMPRIS.paused,

Command-Line Options

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}'
--tooltip-format <string> Metadata format for tooltip (supports {title}, {artist}, {album}) --tooltip-format '{title} - {artist}'
--icon-format <string> Icon format as JSON. 404 means default --icon-format '{"404": "", "vlc": "󰕼", "mpv": "", "spotify": ""}'
--no-icon Disable icon in output --no-icon
--no-status-icon Disables play/pause icon in output --no-status-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.

Preview

Reset mode:

Reset mode

Wrapped mode:

Wrapped mode

Deployment

pid is stored in a file at /tmp/scrollbarmpris/{timestamp}.pid. Use it to track instances

Contributing

Contributions, feature requests, and issue reports are always welcome! Feel free to open an issue or submit a pull request.

Credits

  • ScrollMPRIS and this README were written and improved using AI.

License

Unlicensed. See LICENSE for details.

About

Scrolling MPRIS module for waybar

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages