mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
Merge branch 'module_mpris_bugix' into module_mpris_client_sync_on_startup
This commit is contained in:
commit
39d37b38e6
2 changed files with 15 additions and 8 deletions
|
@ -55,6 +55,11 @@ mpris - This module provides MPRIS status such as currently playing artist/album
|
||||||
: list of string
|
: list of string
|
||||||
: yes
|
: yes
|
||||||
: A list of MPRIS client identities
|
: 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
|
# EXAMPLES
|
||||||
|
|
||||||
|
@ -77,18 +82,19 @@ bar:
|
||||||
# NOTE
|
# NOTE
|
||||||
|
|
||||||
The 'identity' refers a part of your clients DBus bus name.
|
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
|
Systemd: > busctl --user --list
|
||||||
Playerctl: > playerctl --list-all
|
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'.
|
MPRIS client bus names start with 'org.mpris.MediaPlayer2.<identity>'.
|
||||||
For example, firefox may use the bus name
|
For example, firefox may use the bus name:
|
||||||
'org.mpris.MediaPlayer2.firefox.instance_1_7' and its identity would be
|
'org.mpris.MediaPlayer2.firefox.instance_1_7' which
|
||||||
'firefox'
|
gives us the identity 'firefox'
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <systemd/sd-bus-protocol.h>
|
|
||||||
#include <threads.h>
|
#include <threads.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -100,8 +99,8 @@ struct private
|
||||||
int refresh_abort_fd;
|
int refresh_abort_fd;
|
||||||
|
|
||||||
size_t timeout_ms;
|
size_t timeout_ms;
|
||||||
string_array identity_list;
|
|
||||||
struct context context;
|
struct context context;
|
||||||
|
string_array identity_list;
|
||||||
struct particle *label;
|
struct particle *label;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -754,6 +753,8 @@ context_setup(struct context *context)
|
||||||
LOG_INFO("Selecting last registered client: %s", context->current_client->bus_name);
|
LOG_INFO("Selecting last registered client: %s", context->current_client->bus_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context->monitor_connection = connection;
|
||||||
|
|
||||||
/* Turn this connection into a monitor */
|
/* Turn this connection into a monitor */
|
||||||
sd_bus_message *message = NULL;
|
sd_bus_message *message = NULL;
|
||||||
status = sd_bus_message_new_method_call(connection, &message, DBUS_SERVICE, DBUS_PATH, DBUS_INTERFACE_MONITORING,
|
status = sd_bus_message_new_method_call(connection, &message, DBUS_SERVICE, DBUS_PATH, DBUS_INTERFACE_MONITORING,
|
||||||
|
|
Loading…
Add table
Reference in a new issue