从命令行设置 GNOME 夜灯

从命令行设置 GNOME 夜灯

如何从命令行打开或关闭 GNOME 夜灯?我已获得命令,gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled但不知道在其末尾要添加什么标志/参数/其他内容。

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled ON
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled TRUE
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled YES PLEASE

这些都不起作用。

答案1

打开:

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true

把关掉:

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false

为了按时安排,这里我想从 23:06 开始安排夜灯(即 06/60=0.1):

gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-from 23.1

为了安排关闭时间,我想安排夜灯在 23:25 时关闭(即 25/60=0.416666666):

gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-to 23.416666666

您还可以设置夜灯温度,它会增加和减少亮度,4000 是 Ubuntu 18.04 的默认值,您可以尝试不同的值,例如 2000、3000、5000、6000、10000,并设置首选值:

gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 4000

要获取上述命令的当前值,请运行以下命令

gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled 
gsettings get org.gnome.settings-daemon.plugins.color night-light-schedule-from
gsettings get org.gnome.settings-daemon.plugins.color night-light-schedule-to
gsettings get org.gnome.settings-daemon.plugins.color night-light-temperature

例子:

$ gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled
false
$ gsettings get org.gnome.settings-daemon.plugins.color night-light-schedule-from
23.1
$ gsettings get org.gnome.settings-daemon.plugins.color night-light-schedule-to
23.416666666000001
$ gsettings get org.gnome.settings-daemon.plugins.color night-light-temperature
uint32 1000
$

相关内容