From 43de0bb0aac0c8bb13577c7542440ad93a5b7ccc Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:08:46 +0700 Subject: [PATCH] music controls: fix wrong dbus check, show time for chromium + no plasma integration --- .config/ags/modules/indicators/musiccontrols.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.config/ags/modules/indicators/musiccontrols.js b/.config/ags/modules/indicators/musiccontrols.js index f315d2b6e..4da8cceb2 100644 --- a/.config/ags/modules/indicators/musiccontrols.js +++ b/.config/ags/modules/indicators/musiccontrols.js @@ -20,9 +20,13 @@ var lastCoverPath = ''; function isRealPlayer(player) { return ( - (hasPlasmaIntegration && !player.busName.startsWith('org.mpris.MediaPlayer2.firefox')) && // Firefox mpris dbus is useless - !player.busName.startsWith('org.mpris.MediaPlayer2.playerctld') && // Doesn't have cover art - !player.busName.endsWith('.mpd') // Non-instance mpd bus + // Remove unecessary native buses from browsers if there's plasma integration + !(hasPlasmaIntegration && player.busName.startsWith('org.mpris.MediaPlayer2.firefox')) && + !(hasPlasmaIntegration && player.busName.startsWith('org.mpris.MediaPlayer2.chromium')) && + // playerctld just copies other buses and we don't need duplicates + !player.busName.startsWith('org.mpris.MediaPlayer2.playerctld') && + // Non-instance mpd bus + !player.busName.endsWith('.mpd') ); } @@ -381,7 +385,7 @@ const MusicControlsWidget = (player) => Box({ setup: (box) => { box.pack_start(TrackControls({ player: player }), false, false, 0); box.pack_end(PlayState({ player: player }), false, false, 0); - box.pack_end(TrackTime({ player: player }), false, false, 0) + if(hasPlasmaIntegration || player.busName.startsWith('org.mpris.MediaPlayer2.chromium')) box.pack_end(TrackTime({ player: player }), false, false, 0) // box.pack_end(TrackSource({ vpack: 'center', player: player }), false, false, 0); } })