Disable Redshift automatically for movies

Bug #904026 reported by Jendrik Seipp
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Redshift
Fix Released
Wishlist
Unassigned

Bug Description

It would be a great feature addition if Redshift could automatically deactivate itself when a video is watched and reactivate itself after the movie.

Related branches

Revision history for this message
Jon Lund Steffensen (jonls) wrote :

It certainly would. How do you propose this should work? Is there an API for detecting whether a movie is playing that don't know of?

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

We could use the MPRIS DBUS specification. I implemented a small script that displays the status (playing, paused or stopped) for totem. The MPRIS specification is supported by most major video players (totem, vlc).

description: updated
Revision history for this message
Jon Lund Steffensen (jonls) wrote :

That's pretty cool. Your script seems to be specific to totem, however. Could it be made to be agnostic to the media player program in use? I sometimes use totem for playing audio files, in which case I wouldn't want redshift to be disabled. Would it be possible to detect this distinction?

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote : Re: [Bug 904026] Re: Disable Redshift automatically for movies

This script can be used similarly for every media player that supports
the MPRIS DBUS specification. Every major player does that, I think.

MPRIS also supports querying the URI of a file (
http://xmms2.org/wiki/MPRIS_Metadata#.22location.22), so we should be
able to determine the filetype and disable redshift only for movies.

The question that remains is though: How do we get notified when a movie
is started? I have not tried it, but listening to this DBUS signal
http://xmms2.org/wiki/MPRIS#TrackChange should do the trick.
Does redshift already have some kind of DBUS interface?

BTW: Is there a way of disabling redshift from within another program
(keeping the indicator alive of course)?

Revision history for this message
Jon Lund Steffensen (jonls) wrote :

2011/12/16 Jendrik Seipp <email address hidden>:
> This script can be used similarly for every media player that supports
> the MPRIS DBUS specification. Every major player does that, I think.
Yes, but it would still only work for a specific media player, not for
any MPRIS media program that I may decide to launch. In other words, I
would have to tell redshift to montitor totem before I launch totem,
right? Not a great solution, but it could work.

> MPRIS also supports querying the URI of a file (
> http://xmms2.org/wiki/MPRIS_Metadata#.22location.22), so we should be
> able to determine the filetype and disable redshift only for movies.
Same thing here.. not a great solution. We can't really be sure that
the file type can be inferred from an URI (e.g. *.mkv or *.ogg could
be video or only audio).

> The question that remains is though: How do we get notified when a movie
> is started? I have not tried it, but listening to this DBUS signal
> http://xmms2.org/wiki/MPRIS#TrackChange should do the trick.
Yes, should be pretty straight forward.

> Does redshift already have some kind of DBUS interface?
No, but it should :)

> BTW: Is there a way of disabling redshift from within another program
> (keeping the indicator alive of course)?
You can of course send SIGUSR1 to the redshift process, but then
gtk-redshift will lose track of it (I'm currently working on fixing
this so it will probably be possible in the next release).

Changed in redshift:
importance: Undecided → Wishlist
Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Do you still want to include this feature in redshift? How do you think
we should go about this?

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Maybe a simple solution could be to add the options "Disable for 1 hour"
and "Disable for 2 hours" to the indicator menu.

Revision history for this message
Jon Lund Steffensen (jonls) wrote :

2012/1/13 Jendrik Seipp <email address hidden>:
> Maybe a simple solution could be to add the options "Disable for 1 hour"
> and "Disable for 2 hours" to the indicator menu.
That would probably be a better solution right now, and also easier to
implement.

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Would it already be possible to implement the "suspend for 1 hour" functionality, or should we wait for DBUS support?

Revision history for this message
Jon Lund Steffensen (jonls) wrote :

2012/2/1 Jendrik Seipp <email address hidden>:
> Would it already be possible to implement the "suspend for 1 hour"
> functionality, or should we wait for DBUS support?

Should be pretty easy to implement in gtk-redshift. If you can write a
small, clean solution I will apply it this week, and possibly get a
release out in the weekend :)

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Ok, I'll see what I can do ;)

Revision history for this message
Jon Lund Steffensen (jonls) wrote :

Good stuff. Merged.

Changed in redshift:
status: New → Fix Committed
Revision history for this message
Fred (eldmannen+launchpad) wrote :

Maybe not when you watch the video in a window, like if you're just on YouTube and listening to music.
But disable it while the video window is in fullscreen.

Revision history for this message
Fred (eldmannen+launchpad) wrote :

Also you _may_ want to disable redshift when playing fullscreen games.

Changed in redshift:
status: Fix Committed → Fix Released
Revision history for this message
ACG (acgimael) wrote :

Is there a way to turn this feature off? The brightness of some videos can be rather disturbing, especially when watching a video at night.

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

To clarify, redshift does not turn on or off automatically (if I remember correctly). If you don't turn it off manually, it will stay on during the movie.

Revision history for this message
ACG (acgimael) wrote :

That's odd... Every time I try to watch a video on full screen it seems like redshift is deactivated. From the previous records it seemed like this feature was added, especially seeing as that's what I observed.

Revision history for this message
Kuba Niewiarowski (marsjaninzmarsa) wrote :

So, is it resolved or not? "For 2 hours" doesn't mean "automatically", so I think that this should be rather split into two separate issues...

Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

That's true, I agree.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.