Skip to content
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

Enable when playback is detected via MPRIS #217

Open
carlocastoldi opened this issue Nov 6, 2022 · 6 comments
Open

Enable when playback is detected via MPRIS #217

carlocastoldi opened this issue Nov 6, 2022 · 6 comments

Comments

@carlocastoldi
Copy link

MPRIS is a D-Bus API which aims to provide a common programmatic API for controlling media players.
In our case, it is interesting because it provides a mechanism for querying compliant media players, including music players and browsers.

Using the MPRIS API to determine if there currently is any media playing sounds like good option for this extension!

@eonpatapon
Copy link
Owner

Not sure to understand what you are proposing ?

I don't see how MPRIS/music players would interact with Caffeine

@eonpatapon
Copy link
Owner

Ah you mean maybe an option to enable Caffeine when some player is 'play' status ?

@carlocastoldi
Copy link
Author

carlocastoldi commented Jan 12, 2023

Ah you mean maybe an option to enable Caffeine when some player is 'play' status ?

yes, correct! Similar to the option that enables caffeine for fullscreen apps

@stuarthayhurst stuarthayhurst changed the title Enable when playback is detected Enable when playback is detected via MPRIS Dec 1, 2023
@snoopdouglas
Copy link

This feature would be incredibly useful to me, given that I use HDMI audio - so screen off = audio off too.

I've never done any work on GNOME extensions but would be happy to start work on a PR for this. Any pointers would be appreciated.

@eonpatapon
Copy link
Owner

eonpatapon commented Feb 13, 2024 via email

@carlocastoldi
Copy link
Author

I implemented MPRIS trigger in caffeine-ng. You might want to take a hint on the dbus calls I used. It can be useful: https://codeberg.org/WhyNotHugo/caffeine-ng/src/commit/1c638ba251124adb7e4812b717735f4c35fc3784/caffeine/triggers.py#L248

The PRs are !127 and !146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants