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

Commit

Permalink
update an old example to be epic now
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisenaaaa authored Nov 24, 2021
1 parent 3d8856c commit e9a5add
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions examples/mpris.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ const MPRIS_PATH = '/org/mpris/MediaPlayer2';
const PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties';

async function listAll() {
let result = [];
let bus = dbus.sessionBus();
let obj = await bus.getProxyObject('org.freedesktop.DBus', '/org/freedesktop/DBus');
let iface = obj.getInterface('org.freedesktop.DBus');
let names = await iface.ListNames();
for (let n of names) {
if (n.startsWith('org.mpris.MediaPlayer2.')) {
result.push(n);
}
}
let result = names.filter((n) => n.startsWith('org.mpris.MediaPlayer2'))

return result;
}

Expand Down

0 comments on commit e9a5add

Please sign in to comment.