我如何让红移从我的电脑开始?

Dan*_*man 48 startup-applications

我已经Redshift在我的电脑上安装了它,它可以与命令一起正常工作gtk-redshift

但是,在启动应用程序中使用相同的命令时,它不会自动启动。

怎么设置自动启动?

Mar*_*ney 27

由于启动时的地理线索冲突,有一个已知错误#868904会在 11.10 中停止 Redshift 自动启动。

有关在启动时永久设置位置的可能解决方案,请参阅错误报告中的注释 #17

1) 使用http://itouchmap.com/latlong.html或任何其他服务来查找您的纬度/经度

2)调整redshift的启动命令为: gtk-redshift -l <latitude>:<longitude>

阿姆斯特丹红移的纬度/经度示例:gtk-redshift -l 52.37:4.9

据报道,它已在 1.7-1ubuntu2 包中修复,但该项目的 Launchpad 主页仅列出了 35 周前构建的 1.7-0ubuntu1。

您可以尝试直接从他们的网站下载,看看它是否可以解决更高版本的问题。


Geo*_*ell 15

创建一个名为redshift.confin的文件~/.config并将您的坐标添加到其中。它最终应该看起来像这样

[redshift]
location-provider=manual
[manual]
lat=55.0
lon=12.0
Run Code Online (Sandbox Code Playgroud)


Pit*_*kos 9

我会建议两种方式:

  1. 使用 crontab
  2. 使用暴发户

CRONTAB

crontab 是一个一直运行的程序。它有一个包含程序和脚本的列表以及它们应该运行的确切日期或间隔。系统管理员经常使用 Crontab 进行备份和自动化任务。

要查看包含程序的列表,您可以键入

crontab -l
Run Code Online (Sandbox Code Playgroud)

编辑列表类型

crontab -e
Run Code Online (Sandbox Code Playgroud)

最后添加这一行,以便在计算机启动时启动 redshift

@reboot export DISPLAY=:0.0 && /usr/bin/redshift -l 56.20:16.35
Run Code Online (Sandbox Code Playgroud)

其中 56.20:16.35 是LATITUDE:LONGITUTE您所在位置的 。保存并重新启动。

暴发户

Upstart 是一个程序,除其他外,它在启动时在特定文件夹中查找要运行的脚本。所以我们可以在那里添加我们的程序,让它在每次启动时运行。Upstart 比 crontab 更底层,你需要 root 权限。

要添加红移,您只需编辑/etc/rc.local文件。添加路径红移之前exit文件中,否则它将无法运行。您可以通过键入找到路径whereis redshift。该文件应类似于以下内容:

#!/bin/sh -e
pcscd
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/usr/bin/redshift

exit 0
Run Code Online (Sandbox Code Playgroud)

保存并重新启动。