hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DBus service name change

seemoss opened this issue · comments

Describe the bug
In ncspot 1.0.0 the DBus service name has changed from "ncspot" to "ncspot.instancePID", where PID is the random PID of the ncspot process and which changes with every execution.

To Reproduce
Steps to reproduce the behavior:

Prior to ncspot v1:
$ playerctl -l
ncspot
strawberry

With ncspot v1:
$ playerctl -l
ncspot.instance139064
strawberry

Expected behavior
This change, which was presumably made to fix issue "multiple instances interfering with each other's MPRIS implementation", breaks MPRIS control of ncspot with LXQt keyboard shortcuts using direct DBus calls since the ncspot service name is different each time ncspot starts up because of the random PID.

System (please complete the following information):

  • OS: Debian Linux 11 with LXQt
  • NCSpot Version: 1.0.0
  • Installed from: GitHub

Additional context
I have a workaround using playerctl since it seems to be smart enough to match "playerctl -p ncspot play-pause" with whatever ncspot.instancePID is currently running so this is a minor issue at most. I'm not even sure whether this is even "fixable", or whether it's even an ncspot issue or a deficiency with LXQt.

Thank you for all your work on NCSpot either way!

It's intended and not a bug. The MPRIS specification recommends this approach for all programs that do not guarantee a single instance. Firefox for example also takes this approach. If it doesn't work with an MPRIS client, it might be best to create an issue for that specific client to ask whether it's possible to support this behavior.

Figured as much, thanks for responding, closing.