aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--po/cs.po32
-rw-r--r--po/zh_CN.po44
-rw-r--r--redshift.14
-rw-r--r--redshift.conf.sample56
-rw-r--r--src/redshift-gtk/statusicon.py6
6 files changed, 103 insertions, 42 deletions
diff --git a/Makefile.am b/Makefile.am
index a5f5eb4..1e2f1c8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,8 @@ EXTRA_ROOTDOC_FILES = \
HACKING \
DESIGN \
README \
- README-colorramp
+ README-colorramp \
+ redshift.conf.sample
_HICOLOR_FILES = \
data/icons/hicolor/scalable/apps/redshift.svg \
diff --git a/po/cs.po b/po/cs.po
index ccb9868..70be597 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -9,7 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: https://github.com/jonls/redshift/issues\n"
"POT-Creation-Date: 2015-02-22 11:23-0500\n"
"PO-Revision-Date: 2014-12-31 23:54+0000\n"
-"Last-Translator: Jakub Vaněk <vanek.jakub4@seznam.cz>\n"
+"Last-Translator: David Nguyen <varial88@gmail.com>\n"
"Language-Team: Czech <cs@li.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
@@ -50,11 +50,11 @@ msgstr ""
#: ../data/applications/redshift-gtk.desktop.in.h:2
msgid "Color temperature adjustment"
-msgstr ""
+msgstr "Nastavení teploty barev"
#: ../data/applications/redshift-gtk.desktop.in.h:3
msgid "Color temperature adjustment tool"
-msgstr ""
+msgstr "Nástroj pro nastavení teploty barev"
#. TRANSLATORS: Name printed when period of day is unknown
#: ../src/redshift.c:319
@@ -63,15 +63,15 @@ msgstr ""
#: ../src/redshift.c:320 ../src/redshift.c:1546
msgid "Daytime"
-msgstr ""
+msgstr "Den"
#: ../src/redshift.c:321 ../src/redshift.c:1549
msgid "Night"
-msgstr ""
+msgstr "Noc"
#: ../src/redshift.c:322
msgid "Transition"
-msgstr ""
+msgstr "Přechod"
#: ../src/redshift.c:389
#, c-format
@@ -86,22 +86,22 @@ msgstr ""
#. TRANSLATORS: Abbreviation for `north'
#: ../src/redshift.c:404
msgid "N"
-msgstr ""
+msgstr "S"
#. TRANSLATORS: Abbreviation for `south'
#: ../src/redshift.c:406
msgid "S"
-msgstr ""
+msgstr "J"
#. TRANSLATORS: Abbreviation for `east'
#: ../src/redshift.c:408
msgid "E"
-msgstr ""
+msgstr "V"
#. TRANSLATORS: Abbreviation for `west'
#: ../src/redshift.c:410
msgid "W"
-msgstr ""
+msgstr "Z"
#. TRANSLATORS: Append degree symbols after %f if possible.
#. The string following each number is an abreviation for
@@ -723,7 +723,7 @@ msgstr ""
#: ../src/location-geoclue2.c:114
#, c-format
msgid "Unable to obtain location: %s.\n"
-msgstr ""
+msgstr "Nelze zjistit polohu: %s. \n"
#: ../src/location-geoclue2.c:153
#, c-format
@@ -733,12 +733,12 @@ msgstr ""
#: ../src/location-geoclue2.c:168
#, c-format
msgid "Unable to obtain GeoClue client path: %s.\n"
-msgstr ""
+msgstr "Nelze zjistit umístění klienta GeoClue: %s. \n"
#: ../src/location-geoclue2.c:189
#, c-format
msgid "Unable to obtain GeoClue Client: %s.\n"
-msgstr ""
+msgstr "Nelze použít klienta GeoClue: %s. \n"
#: ../src/location-geoclue2.c:228
#, c-format
@@ -748,12 +748,12 @@ msgstr ""
#: ../src/location-geoclue2.c:251
#, c-format
msgid "Unable to start GeoClue client: %s.\n"
-msgstr ""
+msgstr "Nelze spustit klienta GeoClue: %s. \n"
#: ../src/location-geoclue2.c:269
#, c-format
msgid "Unable to connect to GeoClue.\n"
-msgstr ""
+msgstr "Nelze se připojit do GeoClue. \n"
#: ../src/location-corelocation.m:59
msgid "Not authorized to obtain location from CoreLocation.\n"
@@ -770,7 +770,7 @@ msgstr ""
#: ../src/location-corelocation.m:99
msgid "Request for location was not authorized!\n"
-msgstr ""
+msgstr "Poždavek na zjištění polohy nebyl autorizován! \n"
#: ../src/location-corelocation.m:128
msgid "Use the location as discovered by the Corelocation provider.\n"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 854d896..1db4ea1 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -50,38 +50,38 @@ msgstr ""
#: ../data/applications/redshift-gtk.desktop.in.h:2
msgid "Color temperature adjustment"
-msgstr ""
+msgstr "色温调节"
#: ../data/applications/redshift-gtk.desktop.in.h:3
msgid "Color temperature adjustment tool"
-msgstr ""
+msgstr "色温调节工具"
#. TRANSLATORS: Name printed when period of day is unknown
#: ../src/redshift.c:319
msgid "None"
-msgstr ""
+msgstr "无"
#: ../src/redshift.c:320 ../src/redshift.c:1546
msgid "Daytime"
-msgstr ""
+msgstr "白天"
#: ../src/redshift.c:321 ../src/redshift.c:1549
msgid "Night"
-msgstr ""
+msgstr "夜晚"
#: ../src/redshift.c:322
msgid "Transition"
-msgstr ""
+msgstr "过渡"
#: ../src/redshift.c:389
#, c-format
msgid "Period: %s\n"
-msgstr ""
+msgstr "时段: %s\n"
#: ../src/redshift.c:392
#, c-format
msgid "Period: %s (%.2f%% day)\n"
-msgstr ""
+msgstr "时段: %s (%.2f%% 白天)\n"
#. TRANSLATORS: Abbreviation for `north'
#: ../src/redshift.c:404
@@ -265,11 +265,11 @@ msgstr ""
#: ../src/redshift.c:870 ../src/redshift.c:899
#: ../src/redshift-gtk/statusicon.py:260 ../src/redshift-gtk/statusicon.py:466
msgid "Enabled"
-msgstr ""
+msgstr "已启用"
#: ../src/redshift.c:899 ../src/redshift-gtk/statusicon.py:466
msgid "Disabled"
-msgstr ""
+msgstr "已禁用"
#: ../src/redshift.c:927 ../src/redshift.c:1600
msgid "Unable to read system time.\n"
@@ -767,48 +767,48 @@ msgstr ""
#: ../src/redshift-gtk/statusicon.py:265
msgid "Suspend for"
-msgstr ""
+msgstr "停用"
#: ../src/redshift-gtk/statusicon.py:267
msgid "30 minutes"
-msgstr ""
+msgstr "30 分钟"
#: ../src/redshift-gtk/statusicon.py:268
msgid "1 hour"
-msgstr ""
+msgstr "1 小时"
#: ../src/redshift-gtk/statusicon.py:269
msgid "2 hours"
-msgstr ""
+msgstr "2 小时"
#: ../src/redshift-gtk/statusicon.py:277
msgid "Autostart"
-msgstr ""
+msgstr "开机启动"
#: ../src/redshift-gtk/statusicon.py:289 ../src/redshift-gtk/statusicon.py:300
msgid "Info"
-msgstr ""
+msgstr "信息"
#: ../src/redshift-gtk/statusicon.py:294
msgid "Quit"
-msgstr ""
+msgstr "退出"
#: ../src/redshift-gtk/statusicon.py:301
msgid "Close"
-msgstr ""
+msgstr "关闭"
#: ../src/redshift-gtk/statusicon.py:466
msgid "<b>Status:</b> {}"
-msgstr ""
+msgstr "<b>状态:</b> {}"
#: ../src/redshift-gtk/statusicon.py:470
msgid "Color temperature"
-msgstr ""
+msgstr "色温"
#: ../src/redshift-gtk/statusicon.py:474
msgid "Period"
-msgstr ""
+msgstr "时段"
#: ../src/redshift-gtk/statusicon.py:478
msgid "Location"
-msgstr ""
+msgstr "位置"
diff --git a/redshift.1 b/redshift.1
index 1b2961a..607152e 100644
--- a/redshift.1
+++ b/redshift.1
@@ -149,14 +149,14 @@ lat=55.7
lon=12.6
.fi
.SH HOOKS
-Executable files (e.g. scripts) placed in `~/.config/redshift/hooks'
+Executables (e.g. scripts) placed in folder `~/.config/redshift/hooks'
will be run when a certain event happens. The first parameter to the
script indicates the event and further parameters may indicate
more details about the event. The event `period-changed' is indicated
when the period changes (`night', `daytime', `transition'). The second
parameter is the old period and the third is the new period. The event
is also signaled when Redshift starts up with the old period set to
-`none'.
+`none'. Any dotfiles in the folder are skipped.
A simple script to handle these events can be written like this:
.IP
diff --git a/redshift.conf.sample b/redshift.conf.sample
new file mode 100644
index 0000000..633d0b3
--- /dev/null
+++ b/redshift.conf.sample
@@ -0,0 +1,56 @@
+; Global settings for redshift
+[redshift]
+; Set the day and night screen temperatures
+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: 'geoclue', 'geoclue2', '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
diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py
index b766175..5159437 100644
--- a/src/redshift-gtk/statusicon.py
+++ b/src/redshift-gtk/statusicon.py
@@ -29,11 +29,15 @@ import signal
import re
import gettext
+import gi
+gi.require_version('Gtk', '3.0')
+
from gi.repository import Gtk, GLib, GObject
try:
+ gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as appindicator
-except ImportError:
+except (ImportError, ValueError):
appindicator = None
from . import defs