Jump to content
roza

f.lux workflow

Recommended Posts

Updated

 

I've uploaded a modified version at the original download link. The workflow now includes two more options

  • Disable for an hour
  • Disable for a minute

I strongly recommend you to see if disabling works for a minute, and then proceed to use the hour mode. Please let me know in case you face any issues.

Share this post


Link to post

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.

Share this post


Link to post

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?

Share this post


Link to post

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....

Share this post


Link to post

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. 

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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!

Share this post


Link to post

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.

Share this post


Link to post

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! 

Share this post


Link to post

`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?

Share this post


Link to post

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>

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...