Pārlūkot izejas kodu

Added flux app whitelist blog entry

Thomas Buck 7 gadus atpakaļ
vecāks
revīzija
b18ec8342d
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 31 papildinājumiem un 0 dzēšanām
  1. 31
    0
      input/blog/2017/2017_01_21_flux_app_whitelist.md

+ 31
- 0
input/blog/2017/2017_01_21_flux_app_whitelist.md Parādīt failu

@@ -0,0 +1,31 @@
1
+title: Blog
2
+post: Adding full-screen apps to the f.lux whitelist
3
+date: 2017-01-21
4
+comments: true
5
+flattr: true
6
+---
7
+
8
+## {{ page["post"] }}
9
+<!--%
10
+from datetime import datetime
11
+date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
12
+print "*Posted at %s.*" % date
13
+%-->
14
+
15
+The [f.lux utility](https://justgetflux.com) is a Mac OS X application that allows 'warming up' the colors of your monitors at night to reduce strain on the eyes. Of course, this distorts the colors at night, so it of course has the ability to whitelist certain apps. As long as these apps are in the foreground, the f.lux effect is disabled.
16
+
17
+F.lux just lives in the system nav bar, so there's no proper GUI that would allow adding or removing apps from the whitelist. Instead, you can only enable or disable whitelisting for the current foreground App. Of course, this gets problematic when the app in question is only in fullscreen-mode and does not allow the mouse pointer to leave the window.
18
+
19
+So I've developed a little work-around. Taking a look at the flux preferences file in `~/Library/Preferences/org.herf.Flux.plist`, one can easily see that flux adds an entry there for each whitelisted app, the name of this entry is `disable-` followed by the bundle identifier of the disabled app. The value is True when the app is disabled, and False when not.
20
+
21
+So, to add our own apps and games to this, first we need to find out the bundle identifier of our app. You could open the package, locate the plist file and read it manually, or you can ask AppleScript:
22
+
23
+    $ osascript -e 'id of app "Hitman Absolution"'
24
+    com.feralinteractive.hitmanabsolution
25
+
26
+Now, I first tried modifying the flux preferences plist directly, but that doesn't work. Instead, add your new key, in my case for Hitman Absolution, using defaults:
27
+
28
+    defaults write org.herf.Flux disable-com.feralinteractive.hitmanabsolution 1
29
+
30
+To enable flux for you app, just run the last command again replacing the 1 at the end with a 0.
31
+

Notiek ielāde…
Atcelt
Saglabāt