l1na-forever / mpris-notifier Goto Github PK
View Code? Open in Web Editor NEWDependency-light, highly-customizable, XDG desktop notification generator for πΆπ΅ MPRIS status changes πΉ
License: MIT License
Dependency-light, highly-customizable, XDG desktop notification generator for πΆπ΅ MPRIS status changes πΉ
License: MIT License
Tested with Firefox (YouTube Music) and VLC.
notify-send
works and dbus-monitor
shows the events.
Xubuntu 20.04, mpris-notifier
built from source.
Also found this bit when looking through the journal:
xfce4-notifyd[1933]: Failed to set text 'Sunsets & Car Crashes - The Spill Canvas' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity β escape ampersand as &
Helpful of journalctl to specify the expected behavior there.
This sounds like it would be an easy patch and who knows... maybe THAT is the cause of the notification bug #5 !
However, obviously it is not the fix for whatever is causing it to fire multiple notifications.
Hey cool project.
I'm getting an issue where I often am getting multiple track change notifications however. It seems to be related to the ability to fetch artwork.
Something like:
fetch art -> success -> notification
fetch art -> fail -> notification -> fetch art -> success -> notification
fetch art -> fail -> notification -> fetch art -> fail -> notification -> timeout?
I'm not sure where in the codebase it's doing this loop as I haven't learned rust yet. If i get the chance I'll be happy to take a look and send a PR. But logging the issue in case you have time to get to it first!
thanks for this!
Cutting this to myself. After getting a dbus update in Void's repos, mpris-notifier
suddenly stopped connecting:
$ echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/tmp/dbus-28xxxxxxxx,guid=xxxxxxxxx8198ffd295e9c5a5637c20bf
$ mpris-notifier
Error: DBus(Connection(PathDoesNotExist("/tmp/dbus-28xxxxxxxx,guid=xxxxxxxxx8198ffd295e9c5a5637c20bf")))
Looking at the DBus changelog, there's a related behavior change:
On Linux, dbus-daemon and other uses of DBusServer now create a
path-based Unix socket, unix:path=..., when asked to listen on a
unix:tmpdir=... address. This makes unix:tmpdir=... equivalent to
unix:dir=... on all platforms.
Previous versions would have created an abstract socket, unix:abstract=...,
in this situation.
This change primarily affects the well-known session bus when run via
dbus-launch(1) or dbus-run-session(1).
I have a feeling rustbus' session bus address parsing doesn't account for a unix:path
that includes the ,guid=
field.
First off, thank you for making this tool! It's been really useful to me.
I'm currently encountering a bug that occurs when I use playerctl previous
in conjunction with the Spotify web app (controlled via the Chromium MPRIS client), which reliably causes mpris-notifier to panic/crash.
System details:
$ uname -srvmo
Linux 6.1.5-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Jan 2023 22:42:33 +0000 x86_64 GNU/Linux
$ cargo version
cargo 1.68.0-nightly (2381cbdb4 2022-12-23)
$ cargo install --list | rg 'mpris-notifier'
mpris-notifier v0.1.4:
mpris-notifier
I was able to grab the following backtrace:
$ RUST_BACKTRACE=full mpris-notifier
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/hcw/.cargo/registry/src/github.com-1ecc6299db9ec823/mpris-notifier-0.1.4/src/signal_handler.rs:128:23
stack backtrace:
0: 0x55ce4512468a - std::backtrace_rs::backtrace::libunwind::trace::h27f73006c00d225f
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x55ce4512468a - std::backtrace_rs::backtrace::trace_unsynchronized::h5b1e3ed7625da978
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x55ce4512468a - std::sys_common::backtrace::_print_fmt::h2a671809f517f2b1
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/sys_common/backtrace.rs:65:5
3: 0x55ce4512468a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6d0ea0aaa57736e8
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/sys_common/backtrace.rs:44:22
4: 0x55ce45146f5e - core::fmt::write::h6e5c49f92ea0e272
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/core/src/fmt/mod.rs:1208:17
5: 0x55ce4511ee95 - std::io::Write::write_fmt::h6842012d97fc496b
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/io/mod.rs:1682:15
6: 0x55ce45124455 - std::sys_common::backtrace::_print::h1ab4c02867e328ec
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/sys_common/backtrace.rs:47:5
7: 0x55ce45124455 - std::sys_common::backtrace::print::h32598b3616e9614b
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/sys_common/backtrace.rs:34:9
8: 0x55ce45125c3f - std::panicking::default_hook::{{closure}}::h3d50ddf8e1e49d82
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:267:22
9: 0x55ce4512597b - std::panicking::default_hook::h4ce33dc8fd186ef2
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:286:9
10: 0x55ce4512634c - std::panicking::rust_panic_with_hook::h2a4fa5f415ff0032
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:688:13
11: 0x55ce451260a2 - std::panicking::begin_panic_handler::{{closure}}::h713c2df68306363e
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:577:13
12: 0x55ce45124b3c - std::sys_common::backtrace::__rust_end_short_backtrace::h2b698c64fdb8b17b
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/sys_common/backtrace.rs:137:18
13: 0x55ce45125df2 - rust_begin_unwind
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:575:5
14: 0x55ce44e61423 - core::panicking::panic_fmt::hc36243dbd0d8aecb
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/core/src/panicking.rs:64:14
15: 0x55ce44e614fd - core::panicking::panic::he5fb07ffbf75baf5
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/core/src/panicking.rs:112:5
16: 0x55ce44f0339d - mpris_notifier::signal_handler::SignalHandler::handle_signal::h47f8758adca546bf
17: 0x55ce44e8950b - mpris_notifier::main::h6c3e5a0b57ece164
18: 0x55ce44e709b6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8e24cefcafd87243
19: 0x55ce44e7fce5 - std::rt::lang_start::{{closure}}::h321a8788984b762e
20: 0x55ce4511a55c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::ha9cf51e0ef3558b3
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/core/src/ops/function.rs:606:13
21: 0x55ce4511a55c - std::panicking::try::do_call::h9c7493d8ac276d80
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:483:40
22: 0x55ce4511a55c - std::panicking::try::h2bfb1f90507a2474
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:447:19
23: 0x55ce4511a55c - std::panic::catch_unwind::h7be130a8f9b4b90b
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panic.rs:137:14
24: 0x55ce4511a55c - std::rt::lang_start_internal::{{closure}}::h8c58adba4c26b7c4
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/rt.rs:148:48
25: 0x55ce4511a55c - std::panicking::try::do_call::h03c15e8a349a4d2f
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:483:40
26: 0x55ce4511a55c - std::panicking::try::h27f9d1287663c803
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panicking.rs:447:19
27: 0x55ce4511a55c - std::panic::catch_unwind::h2e76d10aa2609bfc
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/panic.rs:137:14
28: 0x55ce4511a55c - std::rt::lang_start_internal::heabf64234330f612
at /rustc/8dfb3395411555e93399671d0c41a4ac9ed62b95/library/std/src/rt.rs:148:20
29: 0x55ce44e896e5 - main
30: 0x7f1715be8290 - <unknown>
31: 0x7f1715be834a - __libc_start_main
32: 0x55ce44e61a45 - _start
at /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115
33: 0x0 - <unknown>
Hey, love this & use it to get desktop notifications for media players that either don't send dbus notifications or want to send their own, uniquely styled notifications that look out of place from the rest of my WM themeing!
The one annoyance is I don't care about some "players" and would like to ignore relaying their mpris notifications to desktop notifications. I.e., Firefox creates excessive messages, like watching a video in firefox will make it start sending mpris messages, and then it proceeds to send one notification for every sound that is made anywhere(like, per slack message, for each tick in a figma timer, etc).
Would love it if we could specify a config option for ignoring specific clients - maybe through the identifier in the bus name? Ideally it wouldn't care about the instance-specific identifier, I want to ignore all *.firefox.*
messages, not just *.firefox.instance9001
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.