Comments (25)
Just in Chrome, if you close the player’s tab, the button still remains and you have to close Chrome (restarting the Gnome Shell does not help) so that the button disappears.
from gnome-shell-extension-mpris-indicator-button.
Chrome's MPRIS implementation is broken. Most of the properties are non-existent. In this particular case CanControl is either false or non-existent. If CanControl is false or non-existent then the controls are hidden.
from gnome-shell-extension-mpris-indicator-button.
You can do then do not show mpris-indicator-button if the player is Chrome?
Because with Chrome and Chromium, it has become useless.
I have with Vivaldi: 2.10.1745.27, and he is on Chromium as well.
I did this with the mediaplayer extension in manager.js
// player DBus name pattern
// let name_regex = /^org\.mpris\.MediaPlayer2\./;
let name_regex = /^org\.mpris\.MediaPlayer2\.(?!chrom)/; // exclude chrome and vivaldi
from gnome-shell-extension-mpris-indicator-button.
You can do then do not show mpris-indicator-button if the player is Chrome?
Because with Chrome and Chromium, it has become useless.I have with Vivaldi: 2.10.1745.27, and he is on Chromium as well.
I'm a Chrome user also. I have been meaning to workaround it.
By spec that property is not expected to change so an option is to just ignore players altogether that lack the property or if it is false. I really don't want to do any blacklisting.
from gnome-shell-extension-mpris-indicator-button.
so an option is to just ignore players altogether that lack the property or if it is false.
And this will prevent the button from showing if one Chrome player?
don't want to do any blacklisting
Yes, the blacklist will not be needed then.
from gnome-shell-extension-mpris-indicator-button.
And this will prevent the button from showing if one Chrome player?
Yes, instead of just hiding the controls the whole player will be ignored and hidden.
from gnome-shell-extension-mpris-indicator-button.
It’s just that in Chrome, if you close the player’s tab, the button still remains and you have to restart the Gnome Shell so that it disappears.
Chrome puts up an interface when something plays and never takes down. In my case if you quit Chrome it goes away.
from gnome-shell-extension-mpris-indicator-button.
if you quit Chrome it goes away.
Yes, that’s what I wrote above, but it’s not convenient.
from gnome-shell-extension-mpris-indicator-button.
Yes, that’s what I wrote above, but it’s not convenient.
Sorry my bad,lol!!! No it's not, but that's not my bug.
from gnome-shell-extension-mpris-indicator-button.
Hands did not reach the fork of the mediaplayer extension, I will wait for the mpris-indicator-button fix with Chrome. )
from gnome-shell-extension-mpris-indicator-button.
Their implementation is absolute shit. For example most of the time I can fire up d-feet to quickly and easily figure out what a player is doing but since they don't even do the absolute most basic thing when it comes to any dbus interface which is make it introspectable, if I want to see what's actually going on I have to put in a bunch of logging in the extension.
from gnome-shell-extension-mpris-indicator-button.
Hands did not reach the fork of the mediaplayer extension, I will wait for the mpris-indicator-button fix with Chrome. )
I'll have something maybe tonight if not in a couple days at most.
from gnome-shell-extension-mpris-indicator-button.
Interesting in argos (which I have for tests) with my modification of mpris.1.1s.sh (originally for Chrome I did not) in Chrome, everything works and play / pause and switch tracks if from the playlist.
But I think that for Chrome with their integrated mpris control this is no longer needed in the mpris-Indicator-Button.
~/.config/argos/mpris.1.1s.sh
#!/usr/bin/env bash
PLAYERS=$(dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep 'org.mpris.MediaPlayer2.' | grep -E 'auryo|rhythmbox|Lollypop|chrome.*')
CUTENT_PLAYER=$(echo "$PLAYERS" | cut -d '"' -f 2 | head -1)
COMMAND_BASE="dbus-send --print-reply --dest=$CUTENT_PLAYER /org/mpris/MediaPlayer2"
PLAY_PAUSE="$COMMAND_BASE org.mpris.MediaPlayer2.Player.PlayPause"
NEXT="$COMMAND_BASE org.mpris.MediaPlayer2.Player.Next"
PREVIOUS="$COMMAND_BASE org.mpris.MediaPlayer2.Player.Previous"
MPRIS_META=$($COMMAND_BASE org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:Metadata)
ARTIST=$(echo "$MPRIS_META" | sed -n '/artist/{n;n;p}' | cut -d '"' -f 2 | cut -c1-30)
SONG_TITLE=$(echo "$MPRIS_META" | sed -n '/title/{n;p}' | cut -d '"' -f 2 | cut -c1-30)
ART_URL=$(echo "$MPRIS_META" | sed -n '/artUrl/{n;p}' | cut -d '"' -f 2)
SONG_TITLE=${SONG_TITLE//&/&}
SONG_TITLE=${SONG_TITLE//|/|}
ARTIST=${ARTIST//&/&}
ARTIST=${ARTIST//|/|}
if [[ "$CUTENT_PLAYER" == *"auryo"* ]]; then
player='auryo'
icon='multimedia-audio-player-symbolic'
elif [[ "$CUTENT_PLAYER" == *"rhythmbox"* ]]; then
player='rhythmbox'
icon='rhythmbox-notplaying'
else
player='lollypop'
icon='org.gnome.Lollypop-symbolic'
fi
if [[ "$ART_URL" == *file://* ]]; then
base64img=$(base64 -w 0 < "${ART_URL//file:///}")
else
base64img=$(curl -s "${ART_URL//large/t200x200}" | base64 -w 0)
fi
PLAYBACK_STATUS=$($COMMAND_BASE org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:PlaybackStatus)
if [[ $PLAYBACK_STATUS == *"Playing"* ]]; then
TITLE="| iconName=media-playback-start"
PLAY_PAUSE_TOGGLE="Pause | iconName=media-playback-pause bash='$PLAY_PAUSE' terminal=false refresh=true"
elif [[ $PLAYBACK_STATUS == *"Paused"* ]]; then
TITLE="| iconName=media-playback-pause"
PLAY_PAUSE_TOGGLE="Play | iconName=media-playback-start bash='$PLAY_PAUSE' terminal=false refresh=true"
else
TITLE="| iconName=$icon"
PLAY_PAUSE_TOGGLE="Play | iconName=media-playback-start bash='$PLAY_PAUSE' terminal=false refresh=true"
fi
if [ "$PLAYERS" == "" ]; then echo "---"; fi
echo "$TITLE"
echo "---"
if [ "$base64img" != "" ]; then echo "| image=$base64img imageWidth=200 imageHeight=200 terminal=false"; fi
if [ "$SONG_TITLE" != "" ]; then echo "<b>$SONG_TITLE</b>"; fi
if [ "$ARTIST" != "" ]; then echo "$ARTIST"; fi
if [ "$SONG_TITLE" != "" ] && [ "$ARTIST" != "" ]; then echo "---"; fi
echo "$PLAY_PAUSE_TOGGLE"
echo "Next | iconName=media-skip-forward bash='$NEXT' terminal=false refresh=true"
echo "Previous | iconName=media-skip-backward bash='$PREVIOUS' terminal=false refresh=true"
if [[ $player == *"rhythmbox"* ]]; then
echo "Show | iconName='$icon' bash='$player' terminal=false"
echo "Quit | iconName=window-close bash='pkill $player' terminal=false"
fi
from gnome-shell-extension-mpris-indicator-button.
I think that for Chrome with their integrated mpris control this is no longer needed
Like I said their implementation is broken. A bunch of other stuff is broken also. Last I checked none of the "can" props actually worked. Play, pause, next and whatnot may still work but the can props are used to tell you what functionality to expose. Again this is not my bug. I'm pretty forgiving when it comes to the spec and I do a pretty good job, I think, of gracefully exposing and hiding features based on what the player says that it supports. I can only do so much. The extension reads all of the properties and decides what to expose based on those properties if a player doesn't even bother to do the bare minimum it's not my problem. It's the player's bug.
from gnome-shell-extension-mpris-indicator-button.
There are really 2 options.
-
Completely ignore a player who's canControl property is not true and not even add it at all to the list of players.
-
Treat canControl as a visible toggle for the player in menu so that if it did change to true it would show up.
In either case until Chrome fixes their shit implementation it wouldn't show up in the extension.
from gnome-shell-extension-mpris-indicator-button.
There are really 2 options.
I think Chrome will not fix it because they implemented the built-in functionality for managing mpris.
So it’s worth applying the first option.
I liked the scroll buttons on the track, in Chrome built-in functionality for managing mpris.
This can be implemented in mpris-indicator-button?
from gnome-shell-extension-mpris-indicator-button.
I think Chrome will not fix it because they implemented the built-in functionality for managing mpris.
I don't even know if that's mpris?
So it’s worth applying the first option.
My concern is that other players may also set canControl at least initially to false also. The video player Celluloid does in the short list of players I've tested so far.
I liked the scroll buttons on the track, in Chrome built-in functionality for managing mpris.
This can be implemented in mpris-indicator-button?
What does it do? Scrolling already does stuff in the extension. There is a lot of mouse wheel and keyboard shortcut functionality.
https://github.com/JasonLG1979/gnome-shell-extension-mpris-indicator-button/wiki/User-Guide
from gnome-shell-extension-mpris-indicator-button.
What does it do?
This is similar to Position Slider, only with the help of buttons, when pressed, moves accelerated along the track forward or backward.
I circled them in the screenshot:
I don't even know if that's mpris?
I don’t even know, but for some reason they broke mpris.
Using the chrome://flags/#global-media-controls
turns on if disable.
I noticed in Rhythmbox, if you do Raise / Minimize Toggle and it is minimized using the Tray Icon plugin (which minimizes the Rhythmbox if you close it), when I do Raise, the spinner at the mouse cursor spins for a long time.
from gnome-shell-extension-mpris-indicator-button.
This is similar to Position Slider, only with the help of buttons, when pressed, moves accelerated along the track forward or backward.
Oh, I thought you were talking about the mouse wheel scroll buttons. Nope, there is no plans to enable any sort of seeking. that's goes back to the whole position slider thing.
I don’t even know, but for some reason they broke mpris.
Using thechrome://flags/#global-media-controls
turns on if disable.
Yep, I know.
I noticed in Rhythmbox, if you do Raise / Minimize Toggle and it is minimized using the Tray Icon plugin (which minimizes the Rhythmbox if you close it), when I do Raise, the spinner at the mouse cursor spins for a long time.
I don't use Rhythmbox nor that plugin. By default Rhythmbox has pretty reasonable behavior. If something is playing and you close the window it hides if nothing is playing it quits. I'm not really sure why you'd need a tray icon plugin with the combination of that behavior and mpris desktop integration?
If Rhythmbox is in the menu that means that the MPRIS interface is still up.
Raising in this extension works like this:
If a window is present it directly activates that window, otherwise if there is no window but a shellApp for the player it activates the shellApp, which basically has the same affect. Otherwise if there is no window and no shellApp and the player's canRaise property is true the mpris raise method is called. If there is no window, no shellApp and canRaise is false or non-existent nothing is done.
from gnome-shell-extension-mpris-indicator-button.
I can’t figure out how to make it so that if canControl = false
do not show the player if there are several or do not show mpris-indicator-button if there is only one player.
I wanted to quickly make a hack, it didn’t work out. (
You could tell how to do it?
from gnome-shell-extension-mpris-indicator-button.
You could tell how to do it?
I'm working on it. My solution so far is to ignore any player that's canControl property is not true. When I say ignore I mean totally reject it really, as in don't add it to the menu, throw an error logging message and ban it for that session (technically as long as the extension is enabled during that session. Disabling and re-enabling the extension would clear the ban list). The ban is so that there would be only one error message per session per misbehaving player. I want logs for bug reports but in this case there's no need for more than one really. There's no need to spam the logs.
I'm still doing some tweaking.
from gnome-shell-extension-mpris-indicator-button.
Waiting for fix )
from gnome-shell-extension-mpris-indicator-button.
Waiting for fix )
Calm down. I'm still testing it with various players.
from gnome-shell-extension-mpris-indicator-button.
@webmastak there, 691888e makes sure players are MPRIS spec compliant and makes sure canControl is true otherwise the player is ignored.
from gnome-shell-extension-mpris-indicator-button.
Yes, this is what was needed, thanks for the correction. )
from gnome-shell-extension-mpris-indicator-button.
Related Issues (20)
- Add an option to "always display the icon as a note symbol" HOT 1
- Icon indicator not showing after launching audacious HOT 3
- Possibly misbehaving with the mpd-mpris service HOT 17
- Add functionali exclude player HOT 1
- Looking for Gnome 3.30 compatible release... HOT 2
- [Feature Request] Auto-pause when new source is playing HOT 1
- Do not show application icons HOT 2
- No volume bar (when using spotify) HOT 1
- increase the hitbox of the buttons HOT 2
- Flathub's Firefox 86 album art image not displayed HOT 3
- Option to incorporate into the menu on the right. HOT 4
- JS Error in _getIcon for Strawberry player (tested on Gnome 40) HOT 2
- Gnome 41 Support? HOT 31
- Possible to remove/hide Playlist option? HOT 2
- [Help] - Tray Icon HOT 5
- It looks like mpris-indicator-button toggles the LoopStatus on startup of sonixd HOT 1
- does not work in Gnome 43 HOT 13
- Dont work in Manjaro Gnome
- GNOME 45 support HOT 1
- Extension is "Outdated" for Ubuntu Focal 20.04
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnome-shell-extension-mpris-indicator-button.