Kilian / f.lux-indicator-applet

This repository is unmaintained. Visit:
https://github.com/xflux-gui/xflux-gui
Other
549 stars 105 forks source link

General revision #22

Closed jbwinters closed 11 years ago

jbwinters commented 11 years ago

Some of the commands to work with xflux didn't seem to be correct, or at least weren't working as expected. I fixed that, fixed the issues with preview and color changing (issue 9 I think), and other defects with the UI. All of the core functionality seems to work and hopefully will be easier for people to update in the future.

Kilian commented 11 years ago

Wow, very impressive! I'll work through this and merge them in sometime this week.

jbwinters commented 11 years ago

I just realized that preview doesn't work during the day. I can see where 'p' would be useful during the day since it will temporarily show the lower color but at night it temporarily changes the screen to its full brightness, which isn't what we want preview to do (right?). Do you know if there's a way to specify the color temperature that p shows? Or the times that xflux changes from day to night and night to day? It would be great if we had the ability to ask xflux whether it's night or day.

herf commented 11 years ago

The preview exits if any input is received (it's not very smart about what kind of interruption it gets.) But the animation should always transition from night to day or vice-versa.

jbwinters commented 11 years ago

Thanks for the response, herf. What I would like the preview to do is this: during the day, transition to the color that the user selects, then back to the daytime color; during the night transition to the color the user selects then back to the nighttime color it is set to. Is there a way to do that with xflux? If not, could you implement a 'kp=#' command to provide that behavior? (Or let me implement it, I have plenty of time to spare right now). At the moment I don't use 'p'- it seems to do what I want during the day but not at night. So I hacked together a preview function that temporarily changes the color with the 'k' command but that only works well at night. I can kind of fix it in my code but it isn't perfect.

Also, how long do preview/color transitions take?

herf commented 11 years ago

Guess I need to try it out! In most versions we preview immediately as you change settings, because the eye takes some time to adjust, so 'preview' is sort of a bad approximation (your eyes have to adjust too fast).

I think the preview is 3-4 seconds each direction right now, and the sunset transition is ~20-30 seconds.

On Jan 29, 2013, at 11:13 AM, Josh Winters notifications@github.com wrote:

Thanks for the response, herf. What I would like the preview to do is this: during the day, transition to the color that the user selects, then back to the daytime color; during the night transition to the color the user selects then back to the nighttime color it is set to. Is there a way to do that with xflux? If not, could you implement a 'kp=#' command to provide that behavior? (Or let me implement it, I have plenty of time to spare right now). At the moment I don't use 'p'- it does what I want during the day but not at night. So I hacked together a preview function that temporarily changes the color with the 'k' command but that only works well at night. I can kind of fix it in my code but it isn't perfect.

Also, how long do preview/color transitions take?

— Reply to this email directly or view it on GitHub.

jbwinters commented 11 years ago

Previewing immediately when the temperature is changed could be a better way to do it. But with xflux I'm trying to preview specific colors during the day, and I'm running into some problems. Following these steps on Ubuntu 12.04 this exposes some issues:

  1. Run "xflux -l 0 -g 75 -k 2000 -nofork" to set it to day
  2. "k=5000" makes it really dark for a second (seems to be around 2000) then transitions back up to 6500 over the normal color change time (3-4 seconds?)
  3. "k=4000" flickers - First it shows 4000, then immediately switches back to 6500, then back to 4000, then slowly transitions back to 6500 (>10 seconds)

So at the moment it wouldn't be a very good user experience to switch colors at all during the day since the behavior isn't consistent. But at the same time 'p' doesn't work the way I want it to at night. Again, I'd be happy to make some changes to xflux if you wouldn't mind letting me, otherwise I'll try to find a way to work around it (but the result might not be as polished as it could be).

Kilian commented 11 years ago

I've been testing a bit and everything works great, except that sometimes, the preferences window wont open properly. A window will be launched but it won't be filled.

I added an icon for the preferences window and when it refuses to open, it doesn't show the icon either, so something might be happening with the init function. Could the preferences dialog be destroyed for some reason and leaving the init function unable to start a second time?

herf commented 11 years ago

The only bug I'm noticing is that "k" interrupts the main animation and skips directly to 2000, which is annoying. So on the initial animation (which is slow) this "cancel animation and go to the end" behavior is sort of ugly. Switching between settings probably should do something nicer, like start animating from the current position.

Kilian commented 11 years ago

While testing around more I found another bug. The autostart value in the gconf-editor was a 0/1 (string) in the current version and is a bool in your version. This means that if people upgrade fluxgui with their current settings, the app will refuse to start. The error is below.

kilian@ktop3:~$ fluxgui
Type mismatch: Expected `bool' got `string' for key /apps/fluxgui/autostart
Critical error. Exiting.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/fluxgui/fluxapp.py", line 276, in <module>
    app = FluxGUI()
  File "/usr/local/lib/python2.7/dist-packages/fluxgui/fluxapp.py", line 30, in __init__
    self.exit(1)
  File "/usr/local/lib/python2.7/dist-packages/fluxgui/fluxapp.py", line 45, in exit
    self.xflux_controller.stop()
AttributeError: 'FluxGUI' object has no attribute 'xflux_controller'
Exception AttributeError: AttributeError("'FluxGUI' object has no attribute 'xflux_controller'",) in <bound method FluxGUI.__del__ of <__main__.FluxGUI object at 0x1919410>> ignored
jbwinters commented 11 years ago

Good point on the bool switch, thanks for doing such thorough testing. I'll fix that and see what I can do about the jumpy transitions. I'm still concerned about the difference in behavior between changing settings at night vs. day. I will look into the preferences window bug too- was there sequence of actions in particular that seemed to cause it to happen? The window shouldn't be destroyed at all until the application exits and every time Preferences.show() is called the window should be repopulated.

Kilian commented 11 years ago

Sweet! Merging this in this weekend :)

jbwinters commented 11 years ago

Cool. I haven't noticed any cases where the preferences window loads empty. Does it still seem to be happening for you?

Kilian commented 11 years ago

Actually, there is another problem: old fluxgui saved the key for colortemp in gconf, new fluxgui saves the value. If you have it set to tungsten (0 : 2700) and update, it breaks on startup.

jbwinters commented 11 years ago

I fixed that and will send another pull request soon, but first I am still concerned about the behavior of preview during the day. For me previewing during the day through the GUI does nothing, and messing around with xflux (using the steps I described in a previous comment) and the XfluxController class has odd behavior. Even just setting the color during the day in the interactive mode of xflux makes it bounce between night and daytime temperatures. Does these things occur for you? Maybe I have an old version of xflux somehow. If they do occur then I'm not really sure how to reliably fix it without changes to xflux.

Kilian commented 11 years ago

They occur for me too, @herf can probably help out here.