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

applet fails to launch silently #66

Open
JCSzamosi opened this issue Dec 21, 2015 · 1 comment
Open

applet fails to launch silently #66

JCSzamosi opened this issue Dec 21, 2015 · 1 comment

Comments

@JCSzamosi
Copy link

On Ubuntu 14.04. I've downloaded and installed the latest version (as of last week). It installed and I have xflux starting automatically, but the f.lux indicator applet won't launch (just fails silently from application launcher)

@ntc2
Copy link

ntc2 commented Feb 21, 2016

This comment includes a fix and a workaround for this issue, or a related issue.

Quick workaround

  1. Disable fluxgui by clicking on the fluxgui applet and choosing "quit" (doing killall fluxgui is not recommended because it will leave around a stale PID file which you'll need to remove with rm ~/.fluxgui.pid before restarting fluxgui).
  2. Unset your colortemp setting by running gconftool-2 --unset /apps/fluxgui/colortemp.
  3. Restart the fluxgui applet by running fluxgui &!.

Explanation of problem and a patch

Not sure if this is the same problem you were having, but for me the flux indicator applet was appearing in my system try, but flux was not dimming my screen, and when I clicked on it and choose "preferences" nothing would happen. Flux had been working previously for me, and I had set it to autostart.

I quit flux by clicking on the applet and choosing "quit", and then started flux in a terminal by typing fluxgui. The applet reappeared and when I clicked on it and chose "preferences" I saw an error in my terminal related to the

self.colsetting.set_active(self.temperature_to_key(self.settings.color))

call in /usr/share/pyshared/fluxgui/fluxapp.py having the wrong type of argument. After a little more poking around, I learned that the self.temperature_to_key(self.settings.color) call was returning None, apparently because the color setting stored in my gconf was somehow invalid (perhaps it became invalid after upgrading the fluxgui package; I saw some code related to upgrades and color settings). So, I edited temperature_to_key to return a default value (corresponding to 6500, which I think is full brightness):

$ diff -U15 /usr/share/pyshared/fluxgui/fluxapp.py.orig /usr/share/pyshared/fluxgui/fluxapp.py 
--- /usr/share/pyshared/fluxgui/fluxapp.py.orig 2016-02-20 22:57:35.084326694 -0800
+++ /usr/share/pyshared/fluxgui/fluxapp.py  2016-02-20 23:12:08.048309987 -0800
@@ -155,30 +155,32 @@

     temperatureKeys = {
                 0:  '2300',
                 1:  '2700',
                 2:  '3400',
                 3:  '4200',
                 4:  '5000',
                 5:  '6500',
                 "off": '6500',
     }

     def temperature_to_key(self, temperature):
         for i, t in self.temperatureKeys.items():
             if t == temperature:
                 return i
+        else:
+            return 5 # Must return an int

     def connect_widget(self, widget_name, connect_target=None,
[...]

After making the above change to /usr/share/pyshared/fluxgui/fluxapp.py the silent failure problem went away for me.

Another, simpler workaround, is probably to clear your gconf settings. You can see your current fluxgui settings using gconftool-2:

 $ gconftool-2  --recursive-list /apps/fluxgui                                                 
 longitude = -122.6223
 colortemp = 2300
 autostart = true
 zipcode = 97232
 latitude = 45.5148

You can clear your current colortemp setting with

$ gconftool-2  --unset /apps/fluxgui/colortemp

but you probably want to turn off fluxgui before doing this.

Flux version

I'm using fluxgui version 1.1.8-4~wily from https://launchpad.net/~nathan-renniewaldock/+archive/ubuntu/flux on Ubuntu 15.10.

ntc2 added a commit to ntc2/f.lux-indicator-applet that referenced this issue Feb 21, 2016
See Kilian#66 (comment) for details. I notice that the version of the code I'm editing here has a different list of color temps than the version I have installed locally, so I'm using a default value of 0 since that should always be valid. I'm sad to see that the 2300 temperature option is gone in the current version of the code :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants