NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.9k stars 13.95k forks source link

Quodlibet D-Bus interface doesn't work #214736

Open ghost opened 1 year ago

ghost commented 1 year ago

Describe the bug

When trying to contact quodlibet over the d-bus interface, it simply fails.

Steps To Reproduce

Steps to reproduce the behavior:

  1. install dbus-send
  2. start playing a song on quodlibet
  3. dbus-send --session /net/sacredchao/QuodLibet --dest=net.sacredchao.QuodLibet --type=method_call --print-reply net.sacredchao.QuodLibet.PlayPause

Output:

Error org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program net.sacredchao.QuodLibet: No such file or directory

Expected behavior

The song should pause

Screenshots

This also happens on d-feet

image

Additional context

The d-bus interface is useful for controlling quodlibet either through scripts or through keybindings (e.g KDE)

KDE shortcut configuration using DBus
KDE shortcut configuration using DBus

Notify maintainers

@coroa pbogdan

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.91, NixOS, 22.11 (Raccoon), 22.11.2251.f7543a7539a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `"nixos-22.11, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
ghost commented 1 year ago

It looks like the dbus service file points to a wrong path

$ cat /nix/store/6m1w86ri6nl57bccj9l07nsgg7gf472k-quodlibet-4.5.0/share/dbus-1/services/net.sacredchao.QuodLibet.service
[D-BUS Service]
Name=net.sacredchao.QuodLibet
Exec=/nix/store/65cp4izx3bllnwqn7c7dhrq9h9gmjkal-python3-3.10.9/bin/quodlibet
$ ls /nix/store/65cp4izx3bllnwqn7c7dhrq9h9gmjkal-python3-3.10.9/bin/quodlibet
No such file or directory

The original file is https://github.com/quodlibet/quodlibet/blob/d34690e4b85a5fc10e7733f1915b9186de2ce992/data/net.sacredchao.QuodLibet.service.in#L3 . mkDerivation must be replacing the @PREFIX@ with the wrong path, but I don't know how it determines which path to use. A manual replace might be necessary...