1 unstable release
0.1.2 | Jan 7, 2025 |
---|---|
0.1.1 |
|
0.1.0 |
|
#311 in Command line utilities
295 downloads per month
110KB
412 lines
Currently Playing Song
A Linux command-line application that displays your current song as a browser source for OBS Studio.
When streaming, you may want your viewers to know what song is currently playing. current_song
will display the song and artist name, album artwork, and a progress bar along with the position
and duration of the current song. While this was primary designed with OBS Studio in mind, it
should work with anything that allows you to embed a web page.
Any media player that correctly supports the MPRIS D-Bus Specification should work without issue.
Installation
The only requirement is Rust. You can download Rust here.
From crates.io
Installing from crates.io is the easiest method. Simply run cargo install current_song
and it will
download and compile the application for you.
From Source
Download or clone this repository, navigate to the folder where Cargo.toml is located, and run:
cargo build --release
The compiled binary will be located at: target/release/current_song
.
Usage
current_song [OPTIONS]
By default, current_song
will attempt to bind to Spotify. If you use a different media player, you
will need to find its name by running current_song
with the --list-players
flag while that player
is open. You can then pass the name using the --player
option.
In OBS Studio, add a browser source and change the URL
property to http://localhost:4640/
. When
using the default configuration, you should also set the Width
to 960 and the Height
to 334. If
you are missing the browser source plugin in OBS Studio, try switching to the Flatpak version as some
distros do not ship OBS with that feature.
It is important to note that current_song
must be running before launching OBS Studio.
Options
--player
: The music or audio player to listen for.--list-players
: Lists all media players that can be watched.--server
: The port that the web server will listen on.--socket
: The port that the web socket will listen on.--widget
: The location of a HTML file containing a custom widget.-h, --help
: Prints simple or detailed help information.
Configuration (Advanced)
If the default widget does not suit your needs or preferences, there are two ways to modify it:
-
You can supply custom CSS rules inside the properties window for the browser source in OBS. This is the preferred method for simple configuration changes such as changing colors or margins.
-
You can create an entirely custom widget and load it into
current_song
by using the--widget
option.
Contributing
Contributions are very welcome whether it's a bug report, a feature request, or suggesting an improvement. You can contribute by opening an issue on Codeberg
Screenshots
License
This software is licensed under the GNU General Public License, version 3.
Dependencies
~13–25MB
~397K SLoC