帮助我解决 Lubuntu 21.04 上 Redshift 的几个问题

帮助我解决 Lubuntu 21.04 上 Redshift 的几个问题

我对 Redshift 有多个问题。

第一个问题与同时运行的两个 Redshift 实例有关。GNOME 系统监视器中有五个进程,如下所示这个图片,但我认为有两个实例,因为我在系统托盘中看到两个图标,如下所示这里,并且两者都像两个实例一样运行。例如,如果我将redshift.conf文件放入~/.config然后重新启动,则两者将互相争斗,在白天不断从红色变为非红色。

但是,如果我重新安装 Redshift,则只有一个实例。重新启动时就会出现问题。

下一个问题与我的文件有关redshift.conf。我已经正确设置了它,使用了正确的纬度和经度,因为我住在美洲,所以都是负数。但是,无论如何,白天都会应用红色效果。这种情况发生在一个 Redshift 实例上。我上面描述了两个 Redshift 实例的情况。

最后,即使关闭了自动启动,Redshift 在我关闭后也会恢复。例如,如果我点击“退出”,红色效果就会消失(如果有的话),系统托盘中的图标会消失,然后会出现一个新图标,红色效果也会消失(如果适用)。当有两个实例和只有一个实例时,就会发生这种情况。

值得注意的几件事是,我使用的是 Lubuntu 21.04,并且我安装了状态图标程序来通过 Discover 控制 Redshift 和 Redshift 本身。

此外,以下是该文件的内容redshift.conf

[redshift]
; Set the day and night screen temperatures
temp-day=5800
temp-night=4800

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature
transition=1

; Set the screen brightness. Default is 1.0
;brightness=0.9
; It is also possible to use different settings for day and night since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel individually)
gamma=0.9

;gamma=0.8:0.7:0.8
; Set the location-provider: 'geoclue', 'gnome-clock', 'manual'
; type 'redshift -l list' to see possible values
; The location provider settings are in a different section.
location-provider=manual

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values
; 'randr' is the preferred method, 'vidmode' is an older API
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings
; e.g. 'redshift -l manual:help'
[manual]
lat=-35
lon=-55

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the second screen.
[randr]
screen=0

有任何想法吗?

答案1

从 20.10 升级到 21.04 后我遇到了同样的问题。

似乎有一个实例由 systemd 启动(崩溃并重新启动多次),还有一个实例通过启用自动启动由应用程序本身启动(创建一个条目~/.config/autostart/redshift-gtk.desktop

通过移除redshift-gtk.desktop闪烁停止了,但 redshift-gtk 仍然崩溃了。我猜想它要么启动得太早,要么缺少 DISPLAY 环境变量。

我很难从 systemd 中删除 redshift。禁用或屏蔽它redshift-gtk.service不起作用。启动时仍然崩溃。我发现您必须使用以下命令禁用该服务:

sudo systemctl --global disable redshift-gtk
sudo systemctl --global disable redshift

如果您通过它启用自动启动,~/.config/autostart/redshift-gtk.desktop它就会按预期工作。

相关内容