当前位置: 首页>>技术问答>>正文


如何在Ubuntu中安装redshift?

,

问题描述

我是linux的新手,我不知道如何安装redshift 1.9.1,配置色温并使其自动启动。我正在使用Ubuntu 14.04 LTS。

最佳解决思路

如今,截至14.04 – redshift默认位于回购中:

sudo apt-get install redshift redshift-gtk

次佳解决思路

最后,它的确有效,感谢user2832080。这就是我做的:

  1. 安装randr依赖项。

    $ sudo apt-get install libxcb1-dev libxcb-randr0-dev libx11-dev
    
  2. 下载redshift 1.9.1并解压缩。

  3. 切换到redshift 1.9.1目录并输入:

    $ ./configure --enable-randr --enable-gui --enable-ubuntu \
    --with-systemduserunitdir=$HOME/.config/systemd/user
    
  4. $ make

  5. $ sudo make install

  6. 在〜/.config创建redshift.conf,请参阅此link

  7. 转到/usr /local /bin并运行redshift-gtk。

  8. 打开自动启动。

第三种解决思路

首先,您需要从提供的git链接下载redshift并将其解压缩。然后查看HACKING文件。它具有从源安装它所需的说明。

我在这里引用它以便于访问:

Build from repository

$ ./bootstrap
$ ./configure

The bootstrap script will use autotools to set up the build environment and create the configure script.

Use ./configure --help' for options. Use–prefix’ to make an install in your home directory. This is necessary to test python scripts. The systemd user unit directory should be set to avoid writing to the system location.

Systemd will look for the unit files in ~/.config/systemd/user so this directory can be used as a target if the unit files will be used. Otherwise the location can be set to no to disable the systemd files.

Example:

$ ./configure –prefix=$HOME/redshift/root \
–with-systemduserunitdir=$HOME/.config/systemd/user

Now, build the files:

$ make

The main redshift program can be run at this point. To install to the prefix directory run:

$ make install

You can now run the python script. Example:

$ $HOME/redshift/root/bin/redshift-gtk

Depenencies

  • autotools, gettext
  • libdrm (Optional, for DRM support)
  • libxcb, libxcb-randr (Optional, for RandR support)
  • libX11, libXxf86vm (Optional, for VidMode support)
  • geoclue (Optional, for geoclue support)

Notes

  • verbose flag is (currently) only held in redshift.c; thus, write all verbose messages there.

希望在几分钟之后你会把它设置好。

现在,您想根据自己的喜好进行配置。

由于我对默认设置非常满意,因此我没有使用高级配置进行攻击。有两种方法可以设置变量。首先,您可以在启动红移时传递它们(例如redshift -l 55.7:12.6 -t 5700:3600),或者如果它太复杂(在〜/.config /redshift.conf上),您可以使用所有设置制作配置文件。最重要的设置是您的位置,即上面的-l变量。在谷歌上找到你的纬度并将其传递到那里。 -t是白天和黑夜的色温。您可以使用man redshift找到更多选项。找到所需的选项后,您只需使用命令将其放在启动程序中即可。 redshift -l 55.7:12.6 -t 5700:3600

您可以在redshift站点上找到更多信息:http://jonls.dk/redshift/

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/1578.html,未经允许,请勿转载。