https://github.com/cjrh/debussy
CLI emitting json when song changes on Linux. Uses MPRIS and dbus to receive events
https://github.com/cjrh/debussy
cli cli-app dbus mpris mpris-dbus-interface mpris2
Last synced: 5 months ago
JSON representation
CLI emitting json when song changes on Linux. Uses MPRIS and dbus to receive events
- Host: GitHub
- URL: https://github.com/cjrh/debussy
- Owner: cjrh
- License: agpl-3.0
- Created: 2022-10-29T12:24:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-29T21:35:38.000Z (6 months ago)
- Last Synced: 2026-01-02T04:30:22.868Z (6 months ago)
- Topics: cli, cli-app, dbus, mpris, mpris-dbus-interface, mpris2
- Language: Rust
- Homepage:
- Size: 133 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# debussy
CLI emitting json when song changes on Linux. Uses MPRIS and dbus to receive events
## demo
In the example below, I'm using the Gnome application _Shortwave_ to listen to
internet radio. The app is detected, and then each track change is received,
and logged, and a json payload generated:
```bash
$ RUST_LOG=info debussy
INFO debussy > Found Shortwave (on bus org.mpris.MediaPlayer2.de.haeckerfelix.Shortwave)
INFO debussy > Radio Paradise (320k)::::Mark Knopfler - Don't You Get It
{"player":"Radio Paradise (320k)","artist":"Radio Paradise (320k)","title":"Mark Knopfler - Don't You Get It"}
```
The logs go to stderr, but the json goes to stdout. This means that
output can be received by other tools in a unix pipeline. For example, streaming
the json data to the program _jq_:
```bash
$ debussy | jq
Compiling debussy v0.1.0 (/home/caleb/tmp/dbustest/debussy)
Finished dev [unoptimized + debuginfo] target(s) in 0.63s
Running `target/debug/debussy`
{
"player": "Radio Paradise (320k)",
"artist": "Radio Paradise (320k)",
"title": "Heilung - Anona"
}
{
"player": "Radio Paradise (320k)",
"artist": "Radio Paradise (320k)",
"title": "The Beatles - Help!"
}
```