You are not logged in.

#1 2024-08-06 19:32:24

AndreyFrantsevich
Member
Registered: 2023-10-30
Posts: 30

[SOLVED] Dbus music control.

Hi there!
I use hyprland + waybar.
I use firefox to listen to music.
Waybar has media player based on playerctl.
So in waybar media player works fine, but when I try to get status by command line as playerctl status there is 'No players found'.
I can manage playerctl with hyprctl dispatch exec playerctl start/stop fine, but I can't get metadata cuz hyprclt just returns ok.
I'm also trying mpris-player-control, but that doesn't work either, maybe because I'm using pipewire.

So in general my question is, how to manage firefox music in my case?
Thanks.

Last edited by AndreyFrantsevich (2024-08-07 20:03:13)

Offline

#2 2024-08-06 20:19:49

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: [SOLVED] Dbus music control.

i uSe fIrEfOx tO LiStEn tO MuSiC.

As long as you actually mean youtube or spotify, look at sth. like https://addons.mozilla.org/de/firefox/a … tegration/ (completely unvetted) because you firs and foremost need firefox to provide an mpris interface.

Offline

#3 2024-08-07 15:04:50

AndreyFrantsevich
Member
Registered: 2023-10-30
Posts: 30

Re: [SOLVED] Dbus music control.

seth wrote:

i uSe fIrEfOx tO LiStEn tO MuSiC.

As long as you actually mean youtube or spotify, look at sth. like https://addons.mozilla.org/de/firefox/a … tegration/ (completely unvetted) because you firs and foremost need firefox to provide an mpris interface.

I think the problem is that I have different dbus sessions.
I don't know how it works exactly, but I found in the discord channel info about my problem:

there's files in ~/.dbus/session-bus for the active session ~/.dbus/session-bus
Just put dbus-launch in front of whatever command your DM runs to start KDE, like it says in the readme.
Both the player app and playerctl should have the same value in DBUS_SESSION_BUS_ADDRESS, or you'll have to rely on them to follow the other session bus discovery specs, which many libraries don't.

I use ly as dm and fish as shell.
I have created a file ~/.profile with dbus-launch.
But it didn't help.
Do you have any ideas?

Offline

#4 2024-08-07 15:08:42

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: [SOLVED] Dbus music control.

1. rather don't use ly, it's session-bus integration is notoriously broken
2. UNDER NO CIRCUMSTANCES! run dbus-lunch. Never! It's not gonna help you.
3.

dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | sed '/string/!d; s/^\s*string //g'

Again: you'll need something to generate an mpris interface for FF itfp

Offline

#5 2024-08-07 15:18:27

AndreyFrantsevich
Member
Registered: 2023-10-30
Posts: 30

Re: [SOLVED] Dbus music control.

seth wrote:

1. rather don't use ly, it's session-bus integration is notoriously broken
2. UNDER NO CIRCUMSTANCES! run dbus-lunch. Never! It's not gonna help you.
3.

dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | sed '/string/!d; s/^\s*string //g'

Again: you'll need something to generate an mpris interface for FF itfp

Output:

"org.freedesktop.DBus"
":1.1"

As I said, playerctl works fine as a waybar widget, I can see the current track, I can stop/play by clicking on the widget.
I can also use playerctl from shell, but through hyprctl as

hyprctl dispatch exec playerctl start/stop

But if I try to use playerctl directly in shell

playerctl start/stop

It doesn't work.

Offline

#6 2024-08-07 15:25:59

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: [SOLVED] Dbus music control.

If that's all, that doesn't look like some healthy session bus.

echo $DBUS_SESSION_BUS_ADDRESS # if this says shows some tmpfile instead of a /run/user path; Do. Not. Run. dbus-launch. Ever.
loginctl session-status

Offline

#7 2024-08-07 15:37:59

AndreyFrantsevich
Member
Registered: 2023-10-30
Posts: 30

Re: [SOLVED] Dbus music control.

seth wrote:

If that's all, that doesn't look like some healthy session bus.

echo $DBUS_SESSION_BUS_ADDRESS # if this says shows some tmpfile instead of a /run/user path; Do. Not. Run. dbus-launch. Ever.
loginctl session-status

echo $DBUS_SESSION_BUS_ADDRESS :

unix:path=/tmp/dbus-6kDO1cT11G,guid=83f3cd32d28337737569e15566b393f8

loginctl session-status

I. Do. Not. Run. dbus-launch.)

Offline

#8 2024-08-07 15:41:23

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: [SOLVED] Dbus music control.

There're 6 session būs, one belongs to at-spi, the others seem to be spawned by fish. is sth. in your shell config.
Get rid of that, whatever that is.

Offline

#9 2024-08-07 16:05:14

AndreyFrantsevich
Member
Registered: 2023-10-30
Posts: 30

Re: [SOLVED] Dbus music control.

seth wrote:

There're 6 session būs, one belongs to at-spi, the others seem to be spawned by fish. is sth. in your shell config.
Get rid of that, whatever that is.

Oh
You were absolutely right!
The fish created extra sessions....
I'm mindlessly copying configs .... Stupid...
Removed that block of code and everything worked....

Thanks a lot!!!!

Offline

#10 2024-08-07 19:49:55

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: [SOLVED] Dbus music control.

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB