「Redshift」の版間の差分
ページの作成:「Category:X サーバー Category:グラフィック Category:視覚効果 Category:音声/動画 en:Redshift ru:Redshift [http://jonls.dk/redshift...」 |
Kusanaginoturugi (トーク | 投稿記録) 校正(でき・出来) |
||
| (7人の利用者による、間の15版が非表示) | |||
| 1行目: | 1行目: | ||
[[Category:X サーバー]] |
[[Category:X サーバー]] |
||
[[Category:グラフィック]] |
|||
[[Category:視覚効果]] |
[[Category:視覚効果]] |
||
[[Category:音声/動画]] |
|||
[[en:Redshift]] |
[[en:Redshift]] |
||
| ⚫ | |||
[[ru:Redshift]] |
|||
| ⚫ | |||
:''Redshift は周りの環境に合わせて画面の色温度を調整します。夜中に画面を睨みながら仕事をしているときに目にかかるダメージを抑えることが可能です。このプログラムは [http://justgetflux.com f.lux] からインスパイアされて |
:''Redshift は周りの環境に合わせて画面の色温度を調整します。夜中に画面を睨みながら仕事をしているときに目にかかるダメージを抑えることが可能です。このプログラムは [http://justgetflux.com f.lux] からインスパイアされて開発されました [...]。'' |
||
{{Note|Redshift は [[Xorg]] でしか機能しません [https://github.com/jonls/redshift/issues/55]。[[Wayland]] はまだサポートされていません。}} |
|||
== インストール == |
== インストール == |
||
{{Pkg|redshift}} パッケージは[[公式リポジトリ]]からインストールできます。また、[[AUR]] の {{AUR|redshift-minimal}} は |
{{Pkg|redshift}} パッケージは[[公式リポジトリ]]からインストールできます。また、[[AUR]] の {{AUR|redshift-minimal}} はできる限り依存パッケージを少なくしたパッケージです。 |
||
=== |
=== フロントエンド === |
||
''redshift-gtk'' コマンドは {{Pkg|redshift}} パッケージにより提供され、Redshiftをコントロールするアイコンをシステムトレイに表示します。 |
|||
デスクトップ環境では、{{Pkg|redshift}} パッケージで {{ic|redshift-gtk}} コマンドがインストールされます。redshift-gtk は redshift をコントロールするためのシステムトレイアイコンを用意します。redshift-gtk を使うには任意の依存パッケージ {{Pkg|python-gobject}}, {{Pkg|python-xdg}}, {{Pkg|librsvg}} が必要です。どれも[[公式リポジトリ]]からインストールできます。[[KDE]] ユーザーは [[AUR]] の {{AUR|kdeplasma-applets-redshift}} パッケージが利用できます。 |
|||
他の同様のパッケージとして{{AUR|redshiftgui-bin}}や{{AUR|redshift-qt}}、{{AUR|redshiftconf}}、{{AUR|plasma5-applets-redshift-control-git}}が提供されています。 |
|||
| ⚫ | |||
| ⚫ | |||
=== 自動起動 === |
=== 自動起動 === |
||
| 23行目: | 27行目: | ||
redshift を自動的に起動する方法は2つ存在します: |
redshift を自動的に起動する方法は2つ存在します: |
||
* 同梱されている systemd サービスユニットファイルを使用する ([[Systemd#ユニットを使う]] |
* 同梱されている systemd サービスユニットファイルを使用する ([[Systemd#ユニットを使う]]を参照)。2つのサービスファイル {{ic|/usr/lib/systemd/user/redshift.service}} と {{ic|/usr/lib/systemd/user/redshift-gtk.service}} があるので、システムトレイアイコンがいるかどうかで、どちらか片方を有効にしてください。 |
||
{{Note| |
{{Note| |
||
| 32行目: | 36行目: | ||
* redshift-gtk が既に起動している場合はシステムトレイアイコンを右クリックして 'Autostart' を選択してください。 |
* redshift-gtk が既に起動している場合はシステムトレイアイコンを右クリックして 'Autostart' を選択してください。 |
||
| ⚫ | |||
| ⚫ | |||
{{Tip|[https://www.latlong.net/ Latlong.net] は緯度と経度を確認できるサービスです。}} |
|||
| ⚫ | |||
| ⚫ | |||
基本設定を使って Redshift を立ち上げるには、次を実行: |
基本設定を使って Redshift を立ち上げるには、次を実行: |
||
$ redshift -l LAT:LON |
|||
LAT はあなたの座標の緯度、LON は |
LAT はあなたの座標の緯度、LON は経度に置き換えてください。 |
||
=== GPS に基づいて自動的に座標を取得 === |
=== GPS に基づいて自動的に座標を取得 === |
||
| 68行目: | 70行目: | ||
; Global settings for redshift |
; Global settings for redshift |
||
[redshift] |
[redshift] |
||
; Set the day and night screen temperatures |
; Set the day and night screen temperatures (Neutral is 6500K) |
||
temp-day=5700 |
temp-day=5700 |
||
temp-night=3500 |
temp-night=3500 |
||
; Enable/Disable a smooth transition between day and night |
; Enable/Disable a smooth transition between day and night |
||
; 0 will cause a direct change from day to night screen temperature. |
; 0 will cause a direct change from day to night screen temperature. |
||
; 1 will gradually increase or decrease the screen temperature |
; 1 will gradually increase or decrease the screen temperature. |
||
transition=1 |
transition=1 |
||
; Set the screen brightness. Default is 1.0 |
; Set the screen brightness. Default is 1.0. |
||
;brightness=0.9 |
;brightness=0.9 |
||
; It is also possible to use different settings for day and night |
; It is also possible to use different settings for day and night |
||
; since version 1.8. |
|||
;brightness-day=0.7 |
;brightness-day=0.7 |
||
;brightness-night=0.4 |
;brightness-night=0.4 |
||
; Set the screen gamma (for all colors, or each color channel |
; Set the screen gamma (for all colors, or each color channel |
||
; individually) |
|||
gamma=0.8 |
gamma=0.8 |
||
;gamma=0.8:0.7:0.8 |
;gamma=0.8:0.7:0.8 |
||
; This can also be set individually for day and night since |
|||
; version 1.10. |
|||
;gamma-day=0.8:0.7:0.8 |
|||
;gamma-night=0.6 |
|||
; Set the location-provider: ' |
; Set the location-provider: 'geoclue2' or 'manual' |
||
; type 'redshift -l list' to see possible values |
; type 'redshift -l list' to see possible values. |
||
; The location provider settings are in a different section. |
; The location provider settings are in a different section. |
||
location-provider=manual |
location-provider=manual |
||
; Set the adjustment-method: 'randr', 'vidmode' |
; Set the adjustment-method: 'randr', 'vidmode' |
||
; type 'redshift -m list' to see all possible values |
; type 'redshift -m list' to see all possible values. |
||
; 'randr' is the preferred method, 'vidmode' is an older API |
; 'randr' is the preferred method, 'vidmode' is an older API. |
||
; but works in some cases when 'randr' does not. |
; but works in some cases when 'randr' does not. |
||
; The adjustment method settings are in a different section. |
; The adjustment method settings are in a different section. |
||
| 99行目: | 107行目: | ||
; Configuration of the location-provider: |
; Configuration of the location-provider: |
||
; type 'redshift -l PROVIDER:help' to see the settings |
; type 'redshift -l PROVIDER:help' to see the settings. |
||
; |
; ex: 'redshift -l manual:help' |
||
; Keep in mind that longitudes west of Greenwich (e.g. the Americas) |
|||
; are negative numbers. |
|||
[manual] |
[manual] |
||
lat=48.1 |
lat=48.1 |
||
| 106行目: | 116行目: | ||
; Configuration of the adjustment-method |
; Configuration of the adjustment-method |
||
; type 'redshift -m METHOD:help' to see the settings |
; type 'redshift -m METHOD:help' to see the settings. |
||
; ex: 'redshift -m randr:help' |
; ex: 'redshift -m randr:help' |
||
; In this example, randr is configured to adjust screen 1. |
; In this example, randr is configured to adjust screen 1. |
||
; Note that the numbering starts from 0, so this is actually the |
; Note that the numbering starts from 0, so this is actually the |
||
; second screen. If this option is not specified, Redshift will try |
|||
; to adjust _all_ screens. |
|||
[randr] |
[randr] |
||
screen=1 |
screen=1 |
||
}} |
|||
=== 実際の画面の明るさを変える === |
|||
Redshift には明るさを調整する機能がありますが、大抵の人が期待するように動作することはありません。ガンマ値を変更することによる擬似的な明度調整であり、画面の明るさが落ちることはないからです [http://jonls.dk/redshift/#known-bugs-and-limitations]。 |
|||
redshift のフックと {{pkg|xorg-xrandr}} と {{pkg|xorg-xbacklight}} を使うことで画面の輝度を変更することが可能です。ただし制約が存在し、ハードウェアによって別の方法でバックライトを制御する必要があります。詳しくは[[バックライト#xbacklight]] を参照してください。 |
|||
{{ic|~/.config/redshift/hooks}} に以下のファイルを作成して実行可能属性を付与してください: |
|||
{{hc| |
|||
~/.config/redshift/hooks/brightness.sh|output=#!/bin/sh |
|||
# Set brightness via xbrightness when redshift status changes |
|||
# Set brightness values for each status. |
|||
# Range from 1 to 100 is valid |
|||
brightness_day="100" |
|||
brightness_transition="50" |
|||
brightness_night="10" |
|||
# Set fade time for changes to one minute |
|||
fade_time=60000 |
|||
case $1 in |
|||
period-changed) |
|||
case $3 in |
|||
night) |
|||
xbacklight -set $brightness_night -time $fade_time |
|||
;; |
|||
transition) |
|||
xbacklight -set $brightness_transition -time $fade_time |
|||
;; |
|||
daytime) |
|||
xbacklight -set $brightness_day -time $fade_time |
|||
;; |
|||
esac |
|||
;; |
|||
esac |
|||
}} |
}} |
||
== トラブルシューティング == |
== トラブルシューティング == |
||
=== |
=== Screen 1 could not be found === |
||
{{ic|redshift.conf}} 設定ファイルの "screen 1" を "screen 0" に変更してください。 |
|||
redshift-gtk を使うには任意の依存パッケージをインストールする必要があります。欠けている依存パッケージがないか確認するには、コマンドラインで {{ic|redshift-gtk}} を実行してください。以下のような出力がされるはずです: |
|||
=== トレイアイコンを左・右クリックしても何も起こらない === |
|||
Traceback (most recent call last): |
|||
{{Pkg|libappindicator-gtk3}} をインストールしてください。詳しくは [https://github.com/jonls/redshift/issues/363] や [https://bugs.archlinux.org/task/49971] を参照。 |
|||
File "/usr/bin/redshift-gtk", line 26, in <module> |
|||
from redshift_gtk.statusicon import run |
|||
=== geoclue2 が原因で Redshift が動作しない === |
|||
File "/usr/lib/python3.4/site-packages/redshift_gtk/statusicon.py", line 31, in <module> |
|||
{{note|以下の方法を使用する前に、redshift-gtk を終了して geoclue サービスを再起動してください。接続がつながるよりも前に位置サービスが起動してしまいサービスが機能しなくなることがあります。}} |
|||
from gi.repository import Gtk, GLib |
|||
ImportError: No module named 'gi.repository' |
|||
[[GNOME]] を使っている場合、"Settings -> Privacy" から位置サービスをオンに切り替えることができます。 |
|||
デフォルトでは、geoclue2 の設定ファイルは Redshift のアクセスを許可しません。以下の行を {{ic|/etc/geoclue/geoclue.conf}} に追加してください: |
|||
{{hc|/etc/geoclue/geoclue.conf|2= |
|||
[redshift] |
|||
allowed=true |
|||
system=false |
|||
users= |
|||
}} |
|||
=== i3 で自動起動しない === |
|||
上記の場合、[[公式リポジトリ]]から {{Pkg|python-gobject}}, {{Pkg|python-xdg}}, {{Pkg|librsvg}} をインストールすれば問題は解決です。 |
|||
[[i3]] の設定ファイルに以下を追加してください: |
|||
exec --no-startup-id redshift-gtk |
|||
== 参照 == |
== 参照 == |
||
* [http://jonls.dk/redshift Redshift ウェブサイト] |
* [http://jonls.dk/redshift Redshift ウェブサイト] |
||
* [ |
* [https://github.com/jonls/redshift Redshift on github] |
||
* {{App|sct|色温度を設定するツール。|https://aur.archlinux.org/packages/sct/|{{AUR|sct}}}} |
|||
2024年7月10日 (水) 21:03時点における最新版
- Redshift は周りの環境に合わせて画面の色温度を調整します。夜中に画面を睨みながら仕事をしているときに目にかかるダメージを抑えることが可能です。このプログラムは f.lux からインスパイアされて開発されました [...]。
インストール
redshift パッケージは公式リポジトリからインストールできます。また、AUR の redshift-minimalAUR はできる限り依存パッケージを少なくしたパッケージです。
フロントエンド
redshift-gtk コマンドは redshift パッケージにより提供され、Redshiftをコントロールするアイコンをシステムトレイに表示します。
他の同様のパッケージとしてredshiftgui-binAURやredshift-qtAUR、redshiftconfAUR、plasma5-applets-redshift-control-gitAURが提供されています。
設定
Redshift を起動するには最低でもあなたの所在地、つまりあなたの今いる場所の緯度と経度が必要になります。Redshift は複数のルーチンを使ってあなたのいる地点を取得します。どれも使用できない場合 (例: ヘルパープログラムが何もインストールされていない場合)、手動で位置を入力してください: ほとんどの都市/場所が wikipedia のページに載っているのでそこから位置情報を取得してください ("座標"のあるページを検索します)。
自動起動
redshift を自動的に起動する方法は2つ存在します:
- 同梱されている systemd サービスユニットファイルを使用する (Systemd#ユニットを使うを参照)。2つのサービスファイル
/usr/lib/systemd/user/redshift.serviceと/usr/lib/systemd/user/redshift-gtk.serviceがあるので、システムトレイアイコンがいるかどうかで、どちらか片方を有効にしてください。
- systemd サービスユニットファイルを使う場合は、次のページに書かれているように DISPLAY 環境変数を設定する必要があります: Systemd/ユーザー#環境変数。'drm' を設定する方法ではこの変数を設定する必要はありません。
- redshift.service はユーザーサービスであり、ディスプレイマネージャの後に起動します。ディスプレイマネージャを使わない場合は、
systemctl --user enable redshiftを使ってください。
- redshift-gtk が既に起動している場合はシステムトレイアイコンを右クリックして 'Autostart' を選択してください。
クイックスタート
基本設定を使って Redshift を立ち上げるには、次を実行:
$ redshift -l LAT:LON
LAT はあなたの座標の緯度、LON は経度に置き換えてください。
GPS に基づいて自動的に座標を取得
gpsd を使うことで GPS 座標を自動的に確かめて Redshift に情報を入力することもできます以下のスクリプトを作成して $lat と $lon を redshift -l $lat;$lon に渡します:
#!/bin/bash date #gpsdata=$( gpspipe -w -n 10 | grep -m 1 lon ) gpsdata=$( gpspipe -w | grep -m 1 TPV ) lat=$( echo "$gpsdata" | jsawk 'return this.lat' ) lon=$( echo "$gpsdata" | jsawk 'return this.lon' ) alt=$( echo "$gpsdata" | jsawk 'return this.alt' ) dt=$( echo "$gpsdata" | jsawk 'return this.time' ) echo "$dt" echo "You are here: $lat, $lon at $alt"
詳しくはフォーラムスレッドの こちらの投稿 を見てください。
手動セットアップ
設定ファイル ~/.config/redshift.conf が存在する場合、Redshift はファイルを読み込みます。ただ、Redshift は設定ファイルを作成しないので、手動で作成しなくてはなりません。ドイツ/ハンブルクの例:
~/.config/redshift.conf
; Global settings for redshift [redshift] ; Set the day and night screen temperatures (Neutral is 6500K) temp-day=5700 temp-night=3500 ; 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.8 ;gamma=0.8:0.7:0.8 ; This can also be set individually for day and night since ; version 1.10. ;gamma-day=0.8:0.7:0.8 ;gamma-night=0.6 ; Set the location-provider: 'geoclue2' or '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. ; ex: 'redshift -l manual:help' ; Keep in mind that longitudes west of Greenwich (e.g. the Americas) ; are negative numbers. [manual] lat=48.1 lon=11.6 ; 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. If this option is not specified, Redshift will try ; to adjust _all_ screens. [randr] screen=1
実際の画面の明るさを変える
Redshift には明るさを調整する機能がありますが、大抵の人が期待するように動作することはありません。ガンマ値を変更することによる擬似的な明度調整であり、画面の明るさが落ちることはないからです [2]。
redshift のフックと xorg-xrandr と xorg-xbacklight を使うことで画面の輝度を変更することが可能です。ただし制約が存在し、ハードウェアによって別の方法でバックライトを制御する必要があります。詳しくはバックライト#xbacklight を参照してください。
~/.config/redshift/hooks に以下のファイルを作成して実行可能属性を付与してください:
~/.config/redshift/hooks/brightness.sh
#!/bin/sh # Set brightness via xbrightness when redshift status changes # Set brightness values for each status. # Range from 1 to 100 is valid brightness_day="100" brightness_transition="50" brightness_night="10" # Set fade time for changes to one minute fade_time=60000 case $1 in period-changed) case $3 in night) xbacklight -set $brightness_night -time $fade_time ;; transition) xbacklight -set $brightness_transition -time $fade_time ;; daytime) xbacklight -set $brightness_day -time $fade_time ;; esac ;; esac
トラブルシューティング
Screen 1 could not be found
redshift.conf 設定ファイルの "screen 1" を "screen 0" に変更してください。
トレイアイコンを左・右クリックしても何も起こらない
libappindicator-gtk3 をインストールしてください。詳しくは [3] や [4] を参照。
geoclue2 が原因で Redshift が動作しない
GNOME を使っている場合、"Settings -> Privacy" から位置サービスをオンに切り替えることができます。
デフォルトでは、geoclue2 の設定ファイルは Redshift のアクセスを許可しません。以下の行を /etc/geoclue/geoclue.conf に追加してください:
/etc/geoclue/geoclue.conf
[redshift] allowed=true system=false users=
i3 で自動起動しない
i3 の設定ファイルに以下を追加してください:
exec --no-startup-id redshift-gtk
参照
- Redshift ウェブサイト
- Redshift on github
- sct — 色温度を設定するツール。