the*_*_17 3 display colors ubuntu f.lux
当有人在我偶然发现的 SU 上的另一个问题中提到它时,我发现了f.lux。从那以后我就一直在使用它,因为它是一个简单、原创、有用的软件。
但是,有时我发现我想在夜间禁用它,以编辑照片或执行其他对颜色敏感的任务。同样,有时我也想在白天启用它,当我关闭我房间的窗户让它完全黑暗并为我的午睡做准备时(我来自哪里,我们几乎每天都小睡)。
考虑到这一点,我开始意识到 f.lux 的非自动版本将是满足我需求的理想版本。我知道有一个选项可以在夜间暂停它,当它自动激活时,但我希望它不要激活,除非我告诉它。
所以,我给你留下截图,在那里(如果你看到我看到的相同的东西)你会注意到没有随意激活/停用的选项。有人知道怎么做这个吗?
也许 Ubuntu 上的 f.lux 有不同的 GUI?
小智 5
我也有这个问题。Redshift是一个开源工具,具有 f.lux 的功能,以及手动设置色温的能力。
f.lux 只有在它认为你所在的地方是晚上时才会改变色温,所以我还写了一个 python 脚本来诱使 f.lux 在白天运行。它计算地球上的相对点并给出这些坐标的通量。
要使用它,您需要将此代码保存在一个文件中,例如flux.py
在您的主目录中。然后,打开终端并使用python ~/flux.py
.
#!/usr/bin/env python
# encoding: utf-8
""" Run flux (http://stereopsis.com/flux/)
with the addition of default values and
support for forcing flux to run in the daytime.
"""
import argparse
import subprocess
import sys
def get_args():
""" Get arguments from the command line. """
parser = argparse.ArgumentParser(
description="Run flux (http://stereopsis.com/flux/)\n" +
"with the addition of default values and\n" +
"support for forcing flux to run in the daytime.",
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument("-lo", "--longitude",
type=float,
default=0.0,
help="Longitude\n" +
"Default : 0.0")
parser.add_argument("-la", "--latitude",
type=float,
default=0.0,
help="Latitude\n" +
"Default : 0.0")
parser.add_argument("-t", "--temp",
type=int,
default=3400,
help="Color temperature\n" +
"Default : 3400")
parser.add_argument("-b", "--background",
action="store_true",
help="Let the xflux process go to the background.\n" +
"Default : False")
parser.add_argument("-f", "--force",
action="store_true",
help="Force flux to change color temperature.\n"
"Default : False\n"
"Note : Must be disabled at night.")
args = parser.parse_args()
return args
def opposite_long(degree):
""" Find the opposite of a longitude. """
if degree > 0:
opposite = abs(degree) - 180
else:
opposite = degree + 180
return opposite
def opposite_lat(degree):
""" Find the opposite of a latitude. """
if degree > 0:
opposite = 0 - abs(degree)
else:
opposite = 0 + degree
return opposite
def main(args):
""" Run the xflux command with selected args,
optionally calculate the antipode of current coords
to trick xflux into running during the day.
"""
if args.force == True:
pos_long, pos_lat = (opposite_long(args.longitude),
opposite_lat(args.latitude))
else:
pos_long, pos_lat = args.longitude, args.latitude
if args.background == True:
background = ''
else:
background = ' -nofork'
xflux_cmd = 'xflux -l {pos_lat} -g {pos_long} -k {temp}{background}'
subprocess.call(xflux_cmd.format(
pos_lat=pos_lat, pos_long=pos_long,
temp=args.temp, background=background),
shell=True)
if __name__ == '__main__':
try:
main(get_args())
except KeyboardInterrupt:
sys.exit()
Run Code Online (Sandbox Code Playgroud)