Merge branch 'module_mpris_bugix' into module_mpris_client_sync_on_startup

This commit is contained in:
haruInDisguise 2025-03-19 20:08:08 +01:00
commit 39d37b38e6
2 changed files with 15 additions and 8 deletions

View file

@ -55,6 +55,11 @@ mpris - This module provides MPRIS status such as currently playing artist/album
: list of string
: yes
: A list of MPRIS client identities
| query_timeout
: int
: no
: Dbus/MPRIS client connection timeout in ms. Try setting/incrementing
this value if the module reports a timeout error. Defaults to 500.
# EXAMPLES
@ -77,18 +82,19 @@ bar:
# NOTE
The 'identity' refers a part of your clients DBus bus name.
You can obtain a list of available bus names using:
You can obtain a list of active client names using:
```
Systemd: > busctl --user --list
Playerctl: > playerctl --list-all
Libdbus: > dbus-send --session --print-reply --type=method_call --dest='org.freedesktop.DBus' /org org.freedesktop.DBus.ListNames ... | grep 'org.mpris.MediaPlayer2'
Libdbus: > dbus-send --session --print-reply --type=method_call \
--dest='org.freedesktop.DBus' /org org.freedesktop.DBus.ListNames
```
The identity refers to the part after 'org.mpris.MediaPlayer2'.
For example, firefox may use the bus name
'org.mpris.MediaPlayer2.firefox.instance_1_7' and its identity would be
'firefox'
MPRIS client bus names start with 'org.mpris.MediaPlayer2.<identity>'.
For example, firefox may use the bus name:
'org.mpris.MediaPlayer2.firefox.instance_1_7' which
gives us the identity 'firefox'
# SEE ALSO

View file

@ -4,7 +4,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <systemd/sd-bus-protocol.h>
#include <threads.h>
#include <time.h>
#include <unistd.h>
@ -100,8 +99,8 @@ struct private
int refresh_abort_fd;
size_t timeout_ms;
string_array identity_list;
struct context context;
string_array identity_list;
struct particle *label;
};
@ -754,6 +753,8 @@ context_setup(struct context *context)
LOG_INFO("Selecting last registered client: %s", context->current_client->bus_name);
}
context->monitor_connection = connection;
/* Turn this connection into a monitor */
sd_bus_message *message = NULL;
status = sd_bus_message_new_method_call(connection, &message, DBUS_SERVICE, DBUS_PATH, DBUS_INTERFACE_MONITORING,