Skip to content

Commit

Permalink
fix example bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Aylur committed Dec 24, 2023
1 parent 6059c72 commit 3ecc2e2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions example/simple-bar/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ const Media = () => Widget.Button({
on_primary_click: () => Mpris.getPlayer('')?.playPause(),
on_scroll_up: () => Mpris.getPlayer('')?.next(),
on_scroll_down: () => Mpris.getPlayer('')?.previous(),
child: Widget.Label({
label: Mpris.bind('players').transform(players => {
if (players[0]) {
const { track_artists, track_title } = players[0];
return `${track_artists.join(', ')} - ${track_title}`;
}
return 'Nothing is playing';
}),
}),
child: Widget.Label('-').hook(Mpris, self => {
if (Mpris.players[0]) {
const { track_artists, track_title } = Mpris.players[0];
self.label = `${track_artists.join(', ')} - ${track_title}`;
} else {
self.label = 'Nothing is playing';
}
}, 'player-changed'),
});

const Volume = () => Widget.Box({
Expand Down

0 comments on commit 3ecc2e2

Please sign in to comment.