Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
mpris: Set app id as identity
Browse files Browse the repository at this point in the history
Flatpak automatically exposes org.mpris.MediaPlayer2.APP_ID as a owned
dbus name.

Fixes: #65
  • Loading branch information
A6GibKm committed Mar 2, 2024
1 parent 8069e5e commit ac8f29c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions build-aux/flatpak/com.vixalien.decibels.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"--socket=fallback-x11",
"--socket=wayland",
"--socket=pulseaudio",
"--env=GJS_DISABLE_JIT=1",
"--own-name=org.mpris.MediaPlayer2.Decibels"
"--env=GJS_DISABLE_JIT=1"
],
"cleanup": [
"/include",
Expand Down
4 changes: 2 additions & 2 deletions src/mpris.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class MPRIS extends DBusInterface {
private app = Gtk.Application.get_default()!;

constructor(public stream: APMediaStream) {
super("org.mpris.MediaPlayer2.Decibels", "/org/mpris/MediaPlayer2");
super(`org.mpris.MediaPlayer2.${pkg.name}`, "/org/mpris/MediaPlayer2");

this.stream.connect(
"notify::title",
Expand Down Expand Up @@ -487,7 +487,7 @@ export class MPRIS extends DBusInterface {
CanSetFullscreen: GLib.Variant.new_boolean(false),
CanRaise: GLib.Variant.new_boolean(true),
HasTrackList: GLib.Variant.new_boolean(false),
Identity: GLib.Variant.new_string("Decibels"),
Identity: GLib.Variant.new_string(application_id),
DesktopEntry: GLib.Variant.new_string(application_id),
SupportedUriSchemes: GLib.Variant.new_strv([]),
SupportedMimeTypes: GLib.Variant.new_strv([]),
Expand Down

0 comments on commit ac8f29c

Please sign in to comment.