前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Linux 开启护眼模式,降低蓝光伤害

Linux 开启护眼模式,降低蓝光伤害

作者头像
莲花海
发布2020-01-21 11:02:32
3.2K0
发布2020-01-21 11:02:32
举报
configure-redshift-in-linux-title.jpg
configure-redshift-in-linux-title.jpg

◎ Redshift

前言

现在几乎每部手机都有护眼模式了,减少蓝光,保护眼睛,人人有则,233333~现在 Windows 系统也自带了这样的功能,当然还有个大名鼎鼎的软件——f.lux,Windows 下很好用,不过 Linux 下我没试过,因为我用了 Redshift

安装

首先更新包信息:

1

root@kali:~# apt-get update

然后查找相关包:

1 2 3 4 5 6 7 8

root@kali:~# apt-cache search redshift awscli - Universal Command Line Environment for AWS gnome-shell-extension-redshift - redshift extension for GNOME Shell gtk-redshift - transitional dummy package plasma-applet-redshift-control - Adjusts the color temperature of your screen redshift - Adjusts the color temperature of your screen redshift-gtk - Adjusts the color temperature of your screen with GTK+ integration sct - Set screen color temperature

要图形界面,安装 redshift-gtk 即可:

1

root@kali:~# apt-get install redshift-gtk

如果没有其它依赖的话,应该会安装 redshift-gtkredshift 两个包。

配置

图形界面的配置就不说了,要开机自启,在托盘(tray)图标鼠标右键,设置开机启动即可。如果报错,可能是默认要系统开启 Location,在 Setting > Privacy > Location Services 这设置 on 开启即可。

当然,如果你不想这样,可以换一种模式,自己输入经纬,百度一下经纬,按格式(见下文)填入即可。或者自己写个配置文件手动配置,首先在目录 ~/.config/ 下新建文件 redshift.conf,然后写入:[1]

1 2 3 4 5 6 7 8

[redshift] location-provider=manual temp-day=5500 temp-night=3700 [manual] lat=39.90 lon=116.38

怎么写,可以输入命令查询:

1 2 3 4 5 6 7 8

root@kali:~# redshift -l manual:help Specify location manually. lat=N Latitude lon=N Longitude Both values are expected to be floating point numbers, negative values representing west / south, respectively.

lat 就是经度,lon 是纬度,必须是浮点值,西经和南纬是负数。比如北京天安门广场,百度到:北纬 39°54′,东经 116°23′。一度(°)被分为 60 角分(′),换算一下:39 + 54 / 60 = 39.90,116 + 23 / 60 ≈ 116.38。[2]

GNOME Shell 插件

在 User Menu 会出来一个开关按钮:

configure-redshift-in-linux-2.jpg
configure-redshift-in-linux-2.jpg

可以在 Tweaks 直接配置:

configure-redshift-in-linux-3.jpg
configure-redshift-in-linux-3.jpg

挺方便的,插件地址:https://extensions.gnome.org/extension/685/redshift/

如果安装了redshift-gtk,建议先卸载再安装这个插件。上面查询到有 gnome-shell-extension-redshift 这个包,故直接 apt-get 安装:

1

root@kali:~# apt-get install gnome-shell-extension-redshift

然后打开 Tweak Tool 开启即可,如果显示 error,可能是由于未安装 redshift 这个包导致的,安装一下即可:

1

root@kali:~# apt-get install redshift

如果你想安装最新版插件按照方法可以参考这篇文章,另亲测 Kali Linux 下,不是 apt-get 方式安装的,按钮开关可能失效。

configure-redshift-in-linux-4.jpg
configure-redshift-in-linux-4.jpg

最后,GNOME 好像已经内置了类似的功能?(上图),在 Setting > Displays > Night Light。


  1. 参考:https://wiki.archlinux.org/index.php/redshift#Configuration
  2. 参考:http://www.cnblogs.com/qumao5736/archive/2012/03/10/2389287.html
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 安装
  • 配置
  • GNOME Shell 插件
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档