---
title: Solution-Redshift- Unable to connect to GeoClue
date: 2018-07-19 16:38:53
tags: ["redshift", "solution"]
---
如果系统本身关闭了 Location 功能,则安装运行 redshift 后将会出现以下错误:
```shell
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.
Unable to connect to GeoClue.
Unable to get location from provider.
```
报错的原因很简单那,没办法获取当前的位置信息(个人猜测:需要利用位置信息来判定 day or night)。
可以尝试运行**man redshift**,在 EXAMPLE 栏目中可以发现,运行 redshift 的时候可以添加精度和维度的参数,或者添加配置文件(`~/.config/redshift.conf`),内容如 manual 中所示:
```conf
[redshift] // required
temp-day=5700
temp-night=3600
gamma=0.8
adjustment-method=randr
location-provider=manual // required
[manual] // required
lat=55.7 // required
lon=12.6 // required
```
建议查询以下当地的 lat 和 lon(可以非精细,但是大概能让 redshift 分清是 day or ngiht),并配置进去。
Solution-Redshift- Unable to connect to GeoClue