Jump to content

f.lux workflow


Recommended Posts

  • 3 weeks later...

This doesn't seem to be controlling the Flux app anymore.

 

Would you be able to identify which version of Flux you are running? (My flux version is 21 on Mountain Lion 10.8.2). Maybe its not compatible with something...

 

Also, the disable portions only work after sunset.

Link to comment

Would you be able to identify which version of Flux you are running? (My flux version is 21 on Mountain Lion 10.8.2). Maybe its not compatible with something...

 

Also, the disable portions only work after sunset.

I'm running Flux 21 on 10.8.3 - the color temperature settings don't seem to affect the app - it works fine on its own, but the script can't touch it. Is there some set-up I'm missing?

Link to comment
  • 2 weeks later...

I'm running Flux 21 on 10.8.3 - the color temperature settings don't seem to affect the app - it works fine on its own, but the script can't touch it. Is there some set-up I'm missing?

 

I'm not sure what the problem could be. I'm on 10.8.2 at the moment, so will test this out again when I up to 8.3....

Link to comment
  • 6 months later...
  • 5 months later...
  • 1 month later...

I think this is not working any more with 10.9. Anyone having the same issue?

 

I have the same issue. Either OS X 10.9 or f.lux 30.0 or both in combination broke this Alfred workflow. Add me to the list of people who'd like to see this fixed.

 

Or if someone could at least explain how the workflow is put together so we can fix it ourselves... that would be much appreciated as well.

Edited by Pennyworth
Link to comment

I think this workflow is not working anymore after the latest flux update. Would anyone be able to fix this? Would be very much appreciated. 

 

 

I have the same issue. Either OS X 10.9 or f.lux 30.0 or both in combination broke this Alfred workflow. Add me to the list of people who'd like to see this fixed.

 

Or if someone could at least explain how the workflow is put together so we can fix it ourselves... that would be much appreciated as well.

 

Alfred 2.3 + OSX 10.9.2 + f.lux 30.1: the workflow seems to be working fine.

Link to comment

Alfred 2.3 + OSX 10.9.2 + f.lux 30.1: the workflow seems to be working fine.

 

I just uninstalled the workflow, updated Alfred to 2.3, reinstalled the workflow, and it still doesn't work. There must be something causing this in my machine as well as the others who are complaining.

Link to comment

F.lux's file structure changed a bit in its newest release. I've updated the workflow on my end, but I'm adding a few more features, and I'll release it shortly.

 

The new preferences in flux are so different I knew there'd be big changes behind the scenes. I gotta say: a big thank you for getting on top of this. Your workflow is awesome!

Link to comment

Okay. I rewrote it, and now you can find it here: http://www.packal.org/workflow/flux.

 

Benzi's version (the initial version) was a bit more responsive because it just output options. This one will show a tiny bit of lag when you're typing because it uses a php script filter to give you the extra information / options.

 

If you want to just disable it for an hour, use the keyword `disflux`; otherwise the keyword is `flux` still.

 

Now you can set the temperature to just about anything you want (well, between 1000 and 27000K), which is outside of the range Flux will let you do in its GUI (3400 to 6500). And I've included some nice presets in there as well.

 

Whenever flux is disabled, you're presented with only one option: "re-enable" flux.

 

You can also try to move into Darkroom mode with this, but the transition is very, very slow because of how flux transitions to lower temperatures. Transitioning from 5000K to 27000K takes no time at all, but transitioning down to 1000K can take over a minute. Transitioning back up or down takes just as long, and that's flux's fault, not mine. Darkroom mode also inverts the colors on your screen. (If you want to play around with color inversion, just press ctl+opt+cmd+8).

 

I've included a fun little mode as well in which you can use your screen to simulate candlelight. The workflow will set your computer to about 1900K and then rapidly change the screen brightness to simulate a candle flickering. Two warnings: (1) if you try to use this while working on your computer, you will go insane. (2) I don't know if this is bad for your screen. If it is, and you use it, and your screen breaks, then it's not my fault.

 

To get out of either darkroom or mood lighting mode, then just call `flux` again, and you'll be presented with the option to restore flux to normal behavior. Your screen will stop flickering and/or revert to normal coloring.

 

Let me know if anything is broken.

Link to comment

Okay. I rewrote it, and now you can find it here: http://www.packal.org/workflow/flux.

 

Benzi's version (the initial version) was a bit more responsive because it just output options. This one will show a tiny bit of lag when you're typing because it uses a php script filter to give you the extra information / options.

 

If you want to just disable it for an hour, use the keyword `disflux`; otherwise the keyword is `flux` still.

 

Now you can set the temperature to just about anything you want (well, between 1000 and 27000K), which is outside of the range Flux will let you do in its GUI (3400 to 6500). And I've included some nice presets in there as well.

 

Whenever flux is disabled, you're presented with only one option: "re-enable" flux.

 

You can also try to move into Darkroom mode with this, but the transition is very, very slow because of how flux transitions to lower temperatures. Transitioning from 5000K to 27000K takes no time at all, but transitioning down to 1000K can take over a minute. Transitioning back up or down takes just as long, and that's flux's fault, not mine. Darkroom mode also inverts the colors on your screen. (If you want to play around with color inversion, just press ctl+opt+cmd+8).

 

I've included a fun little mode as well in which you can use your screen to simulate candlelight. The workflow will set your computer to about 1900K and then rapidly change the screen brightness to simulate a candle flickering. Two warnings: (1) if you try to use this while working on your computer, you will go insane. (2) I don't know if this is bad for your screen. If it is, and you use it, and your screen breaks, then it's not my fault.

 

To get out of either darkroom or mood lighting mode, then just call `flux` again, and you'll be presented with the option to restore flux to normal behavior. Your screen will stop flickering and/or revert to normal coloring.

 

Let me know if anything is broken.

 

Hey Shawn,

I can't seem to input any commands other than "flux" and "disflux". Do I need to install anything in addition? (It also will not open flux if flux is not running, even though it says that it opened it). 

 

Thank you for working so hard and bringing so many features to Flux! 

Link to comment

`flux` is the main command, and then the rest of sub-commands that work with the script filters. So, try to type `flux co`, and wait half a second. If the script filter dies, then open the debugger, run it again, and let me know what's messing up.

 

I made an assumption that flux is at /Applications/Flux.app. I should have put in some checking to make sure that it's there, a fall back to see if it's at ~/Applications/Flux.app, and then a last fallback after that.

 

Can you get back to me about the commands working / not working?

Link to comment

Commands aren't working for me. Flux is at /Applications/Flux.app. Here's the debugger report from typing "flux co":

Starting debug for 'f.lux'

[ERROR: alfred.workflow.input.scriptfilter] Code 0: 2014-05-12 10:06:21.465 defaults[47405:d07] 
The domain/default pair of (/Users/paul/Library/Preferences/org.herf.Flux.plist, sleepLate) does not exist
2014-05-12 10:06:21.604 defaults[47406:d07] 
The domain/default pair of (/Users/paul/Library/Preferences/org.herf.Flux.plist, under18) does not exist
2014-05-12 10:06:21.891 defaults[47408:d07] 
The domain/default pair of (/Users/paul/Library/Preferences/org.herf.Flux.plist, sleepLate) does not exist
2014-05-12 10:06:22.066 defaults[47409:d07] 
The domain/default pair of (/Users/paul/Library/Preferences/org.herf.Flux.plist, under18) does not exist
[ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 4.)'. Row 1, Col 1: 'Document is empty' in XML:
Warning: date_sunset(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/paul/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A9644EBB-590C-455C-8F5F-AAEC06E29121/control-functions.php on line 134

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/paul/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A9644EBB-590C-455C-8F5F-AAEC06E29121/control-functions.php on line 138

Warning: localtime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/paul/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A9644EBB-590C-455C-8F5F-AAEC06E29121/control-functions.php on line 168

Warning: date_sunset(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/paul/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A9644EBB-590C-455C-8F5F-AAEC06E29121/control-functions.php on line 134

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/paul/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A9644EBB-590C-455C-8F5F-AAEC06E29121/control-functions.php on line 138

Warning: localtime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/paul/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A9644EBB-590C-455C-8F5F-AAEC06E29121/control-functions.php on line 168
<?xml version="1.0"?>
<items><item uid="" arg="" valid="no" autocomplete=""><title>Current Color Temp: 2700K (Sunset)</title><subtitle></subtitle><icon></icon></item><item uid="color" arg="color" valid="no" autocomplete="color"><title>Set Current Color Temp</title><subtitle>Either as number or preset.</subtitle><icon></icon></item><item uid="set" arg="set" valid="no" autocomplete="set"><title>Set Preference</title><subtitle></subtitle><icon></icon></item><item uid="disable" arg="disable" valid="yes" autocomplete="disable"><title>Disable for an hour</title><subtitle></subtitle><icon></icon></item><item uid="darkroom" arg="darkroom" valid="yes" autocomplete="darkroom"><title>Enter Dark Room Mode</title><subtitle>You need to have the correct Accessibilty Settings.</subtitle><icon></icon></item><item uid="mood" arg="mood" valid="yes" autocomplete="mood"><title>Enter Mood Lighting Mode</title><subtitle>Don't use this when actively using you computer.</subtitle><icon></icon></item></items>
Link to comment

Okay, I see what's happening.

 

(1) Your timezone settings are set in your php.ini (don't worry about this). I included some code that was supposed to get past that error by getting the TZ from your system and temporarily setting it, but, apparently, it's either (1) not working in regards to the sunset/sunrise time functions or (2) I'm not calling it early enough.

 

(2) Flux doesn't write the plist settings for values until you set them. I'll add in the error handling for those.

 

I have a long day of grading papers, but I'll try to squeeze in some time to fix these errors in between. Otherwise, I'll fix it up tomorrow.

 

Thanks for the log. It's just what I needed.

Link to comment

Okay. I just pushed a new version to Packal that should fix the problems.

 

Notes:

I'm not sure when this changed, but I used to be able to use `systemsetup -gettimezone` to get the user's timezone when it wasn't set in /etc/php.ini, but now that needs an admin password. So, I went about a different hack. Now, I'm using this code:

tz=`ls -l /etc/localtime` && echo ${tz#*/zoneinfo/}

Basically, your timezone is stored as a symbolic link called /etc/localtime. That actually links to 

/usr/share/zoneinfo/America/New_York

for me. The naming ____should____ be consistent in that after "zoneinfo/" will be your PHP-readable timezone. So, if this fails for you, please let me know and let me know what that symlink is for your system. Again, it should work, but I can't realistically test it for all timezones.

 

For the other errors, I just silenced STDERR, so the warning that happens when Flux hasn't written a (unnecessary) default to the plist won't appear anymore, and the script should function perfectly well.

 

Apologies for the initial errors. Hope this fixes everything.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...