-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mpris blacklist support #390
base: main
Are you sure you want to change the base?
Conversation
When I run the formatter, there are quite a few changes to the |
Great to see progress on this.... and to see where my code was convoluted :) Regards |
Alright, so with config as so;
SwayNC reports at startup;
So regex is being respected, and the annoying firefox tabs each creating their own instance is no longer showing in SwayNC. Thumbsup, I approve. |
I'll get to this after the upcoming bug release :) |
I've noticed that firefox instances aren't always blacklisted from the mpris module; Upon swaync startup, instances are identified and removed. Great. I've yet to produce a repeatable scenario for this, however have noticed it happening quite a few times. |
I'll wait until this is resolved then |
May I suggest that we merge this still? It still improves the functionality since currently, FF will always be duplicated anyway. Also we avoid having stale PRs for things that are already done (even if there is some unknown issue). If there is some quirk, it can be fixed later. It would also help having more people use this and reporting so we can pinpoint the issue. Otherwise, we risk never finding the cause and this PR will just stay open forever. |
I believe, without reviewing the code but from the observed behavior, that this is simply caused by the mpris widget lacking a hook which checks if new players are in the blacklist prior to adding them first. @abmantis makes some points, though can also accept it's best a feature is complete before merge. |
I'd rather not merge incomplete features |
@MrPenguin07 any findings? |
@ErikReider I was now able to reproduce the issue mentioned by @MrPenguin07 and just fixed it. |
I appreciate your taking the time to hash this one out, glad to see my suspicion was correct. I've pulled your latest commit, built swaync and .... Am happy to be greeted by this when a new player is added, without needing to reload swaync. I consider this feature to now be complete @ErikReider |
I initially misinterpreted your description of the issue, that is why I was not able to reproduce it. @ErikReider are you ok with moving this forward now? |
@abmantis I like this, but I think it's better to keep only necessary changes, |
Closed by mistake. I thought this was pushed to |
Removed the flake.nix file, which was committed by mistake. |
I think it would be better to keep this PR and to have separate PRs. |
Reporting: 2 weeks of testing these commits and the mpris blacklist continues to work perfectly. |
@@ -174,6 +184,7 @@ namespace SwayNotificationCenter.Widgets.Mpris { | |||
string[] names = dbus_iface.list_names (); | |||
foreach (string name in names) { | |||
if (!name.has_prefix (MPRIS_PREFIX)) continue; | |||
if (is_blacklisted(name)) continue; | |||
if (check_player_exists (name)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may change this line to fix the unintended return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm too ignorant about it, I'm seeing that my report was merged in this PR, but I don't know how to use info written here to fix the issue with my Swaync. I uninstalled the one I got from Arch repo, and compiled this one, still having the same issue: Swaync shows MPRIS module when nothing is being played, and when there's something being played, I have two different MPRIS modules in Swaync. What I am missing?
Thanks in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm too ignorant about it, I'm seeing that my report was merged in this PR, but I don't know how to use info written here to fix the issue with my Swaync. I uninstalled the one I got from Arch repo, and compiled this one, still having the same issue: Swaync shows MPRIS module when nothing is being played, and when there's something being played, I have two different MPRIS modules in Swaync. What I am missing?
Thanks in advance.
By "compiled this one" do you mean you've cloned SwayNotificationCenter repo, pulled the commits to your repo and then built that?
Or are you manually patching the source?
I get the feeling you may simply be building master
from this repo without the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just cloned and built it. No commits pulled. I don't know how to pull the commits separately, I tried to just copy/paste the changes but apparently I did it wrongly, and I wasn't able to modify the installation...
Sorry for the ignorance :(
EDIT: I found how to download mpris.vala and replaced the one in /src/controlCenter/widgets/mpris folder. Added "blacklist": [] in my config.json (the one I have configured already, since that's the one active in my dotfiles), rebuilt it, problem continues: I have two different mpris modules, and when nothing is being played, module is there.
EDIT 2: I finally got it. I'm a complete noob and I had no idea what to do, so just intuition led me to the answer: I had to write "playerctl" to blacklist it, and that's it.
I'll close the PR. Thanks for this solution!
Continuation of PR #324.