汇编

汇编

红移

大多数发行版中提供的软件包的日期为 2016-01-02,即 2.5 年前。

就像我的系统 - Linux Mint 19 Cinnamon 64 位 - 只有1.11版本可用的:

$ apt-cache policy redshift
redshift:
  Installed: (none)
  Candidate: 1.11-1ubuntu1
  Version table:
     1.11-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

请注意,Linux Mint 19 基于最新的 Ubuntu 18.04。

这可能是由于以下代码中的提交太少造成的1.12版

不管怎样,我个人认为1.12版这是向前迈出的相当关键的一步。


问题

不管怎样,我的问题是,如何在不添加任何 PPA 的情况下安装新版本?

让我重新表述一下。我该如何安装红移1.12Linux Mint 19 Cinnamon 的源码?

请务必包括基本设置和设置,因为我还不熟悉其设置。

答案1

由于您使用的是 Debian 衍生版本,因此您可以重建版本 1.12 的打包源:

cd ${TMPDIR:-/tmp}
sudo apt install devscripts debian-keyring
dget -x http://deb.debian.org/debian/pool/main/r/redshift/redshift_1.12-2.dsc
cd redshift-1.12
sudo apt build-dep redshift
dpkg-buildpackage -us -uc
sudo dpkg -i ../redshift{,-gtk}_1.12-2_*.deb

与直接从源代码安装相比,有许多优点:

  • 您不需要清除现有的包;
  • 更新后的软件仍由包管理系统管理;
  • 将来对该软件包的升级将无需再次重建(或卸载手动安装的软件并安装该软件包)。

如果需要重新访问配置,请参阅弗拉斯蒂米尔回答了解详情。

答案2

汇编

如果您有经验,可以跳过此部分,因为您不会在这里找到任何新内容。

首先,我们需要从系统中清除旧版本。

编译时,我总是清除而不是删除,因为通常某些路径会改变。

sudo apt-get purge redshift redshift-gtk

然后,我们准备编译。幸运的是,在这种情况下,可以简单地通过以下方式完成:

sudo apt-get build-dep redshift-gtk

可能是因为自上次打包版本以来依赖关系没有改变。

现在,我们需要源代码,我总是为编译后的程序创建一个新文件夹,所以:

mkdir redshift && cd redshift

接下来是源码的下载:

wget https://github.com/jonls/redshift/releases/download/v1.12/redshift-1.12.tar.xz

并解压存档,同时再次直接进入创建的目录:

tar -xJf redshift-1.12.tar.xz && cd redshift-1.12

让我们configure使用适当的开关运行脚本:

./configure # --enable-gui --enable-ubuntu

顺便说一句,虽然--enable-gui默认情况下启用了它,但它在我的 Linux Mint 上并没有--enable-ubuntu默认启用,我相信它应该这样做。不过,无论如何,我看不出有什么区别。所以,默认配置可能就可以了。

然后编译它:

make

配置

您必须手动创建配置目录,因为它在此版本中移动,但如果该目录不存在则回退:

mkdir ~/.config/redshift

使用您最喜欢的文本编辑器来创建和编辑配置文件,我将使用VS代码这里:

code ~/.config/redshift/redshift.conf

示例配置文件有大量注释。

; Global settings file for Redshift application.
[redshift]


; The location provider for solar elevation.
; ------------------------------------------------------------------------------
; Set the location-provider: 'geoclue2' or 'manual'.
; The actual provider settings are in a separate section.
location-provider=manual


; Smooth fade between temperatures when Redshift starts and stops.
; ------------------------------------------------------------------------------
; - 0 will cause an immediate change between screen temperatures.
; - 1 will gradually apply the new screen temperature over a couple of seconds.
fade=0


; Solar elevation thresholds.
; ------------------------------------------------------------------------------
; By default, Redshift will use the current elevation of the sun to determine
; whether it is daytime, night or in transition (dawn / dusk). When the sun is
; above the degrees specified with elevation-high it is considered daytime and
; below elevation-low it is considered night.
;elevation-high=3
;elevation-low=-6


; Day and night screen temperatures.
; ------------------------------------------------------------------------------
; Default temperatures:
; - Day time  : 6500K
; - Night time: 4500K
temp-day=6000
temp-night=4500


; Custom dawn / dusk times.
; ------------------------------------------------------------------------------
; Instead of using the solar elevation, the time intervals of dawn and dusk can
; be specified manually. The times must be specified as HH:MM in 24-hour format.
dawn-time=00:00
dusk-time=15:00


; The adjustment method: 'randr', 'vidmode'.
; ------------------------------------------------------------------------------
; This has changed since the 1.12 version in favor of randr
; formerly vidmode has mostly been used from what I read.
adjustment-method=randr


; Manual GPS of the location for solar elevation.
; ------------------------------------------------------------------------------
; Standard longitude and latitude coordinates.
[manual]
lat=00.8111306
; EDIT THIS ^^
lon=00.1414300
; EDIT THIS ^^


; Adjustment method settings.
; ------------------------------------------------------------------------------
; Note that the numbering starts from 0, so 1 is actually the second screen.
; This actually works for all monitors, needs clarification!
[randr]
screen=0

安装

我建议在实际安装之前尝试编译版本。

由于某种原因,编译后的 GTK 二进制文件无法执行,因此请尝试一下:

chmod u+x ./src/redshift-gtk/redshift-gtk
./src/redshift-gtk/redshift-gtk

如果运行良好,则安装它:

sudo make install

相关内容