aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2010-06-10 20:14:13 +0200
committerJon Lund Steffensen <jonlst@gmail.com>2010-06-10 20:14:13 +0200
commit222c21e5d28864175b405cba701fd9dbfede6f8c (patch)
tree7d9b902145d9ca58a99e660f300191e895504f2e
parentUse AM_SILENT_RULES, if available, to supress verbose make output. (diff)
downloadredshift-ng-222c21e5d28864175b405cba701fd9dbfede6f8c.tar.gz
redshift-ng-222c21e5d28864175b405cba701fd9dbfede6f8c.tar.bz2
redshift-ng-222c21e5d28864175b405cba701fd9dbfede6f8c.tar.xz
Add reset option (activated with -x) that removes any color adjustments
applied to the screen. Based on patch by Dan Helfman.
-rw-r--r--po/da.po85
-rw-r--r--po/redshift.pot85
-rw-r--r--po/ru.po85
-rw-r--r--src/redshift.c153
4 files changed, 227 insertions, 181 deletions
diff --git a/po/da.po b/po/da.po
index ca428a6..1805426 100644
--- a/po/da.po
+++ b/po/da.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: redshift\n"
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/redshift\n"
-"POT-Creation-Date: 2010-06-10 13:27+0200\n"
+"POT-Creation-Date: 2010-06-10 20:13+0200\n"
"PO-Revision-Date: 2010-05-05 22:20+0000\n"
"Last-Translator: Jon Lund Steffensen <Unknown>\n"
"Language-Team: Danish <da@li.org>\n"
@@ -17,17 +17,17 @@ msgstr ""
"X-Launchpad-Export-Date: 2010-05-06 04:09+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: src/redshift.c:233
+#: src/redshift.c:243
#, c-format
msgid "Period: Night\n"
msgstr "Periode: Nat\n"
-#: src/redshift.c:240
+#: src/redshift.c:250
#, c-format
msgid "Period: Transition (%.2f%% day)\n"
msgstr "Periode: Overgang (%.2f%% dag)\n"
-#: src/redshift.c:244
+#: src/redshift.c:254
#, c-format
msgid "Period: Daytime\n"
msgstr "Periode: Dag\n"
@@ -37,20 +37,20 @@ msgstr "Periode: Dag\n"
#. DAY is temperature at daytime,
#. NIGHT is temperature at night
#. no-wrap
-#: src/redshift.c:259
+#: src/redshift.c:269
#, c-format
msgid "Usage: %s -l LAT:LON -t DAY:NIGHT [OPTIONS...]\n"
msgstr "Brug: %s -l BRED:LÆNG -t DAG:NAT [TILVALG...]\n"
#. TRANSLATORS: help output 2
#. no-wrap
-#: src/redshift.c:265
+#: src/redshift.c:275
msgid "Set color temperature of display according to time of day.\n"
msgstr "Indstil skærmens farvetemperatur ud fra klokkeslæt.\n"
#. TRANSLATORS: help output 3
#. no-wrap
-#: src/redshift.c:271
+#: src/redshift.c:281
msgid ""
" -h\t\tDisplay this help message\n"
" -v\t\tVerbose output\n"
@@ -61,7 +61,7 @@ msgstr ""
#. TRANSLATORS: help output 4
#. `list' must not be translated
#. no-wrap
-#: src/redshift.c:278
+#: src/redshift.c:288
#, fuzzy
msgid ""
" -g R:G:B\tAdditional gamma correction to apply\n"
@@ -71,6 +71,7 @@ msgid ""
" -m METHOD\tMethod to use to set color temperature\n"
" \t\t(Type `list' to see available methods)\n"
" -o\t\tOne shot mode (do not continously adjust color temperature)\n"
+" -x\t\tReset mode (remove adjustment from screen)\n"
" -r\t\tDisable temperature transitions\n"
" -t DAY:NIGHT\tColor temperature to set at daytime/night\n"
msgstr ""
@@ -85,7 +86,7 @@ msgstr ""
" -t DAG:NAT\tFarvetemperatur som sættes hhv. dag og nat\n"
#. TRANSLATORS: help output 5
-#: src/redshift.c:293
+#: src/redshift.c:304
#, c-format
msgid ""
"Default values:\n"
@@ -99,162 +100,162 @@ msgstr ""
" Nattemperatur: %uK\n"
#. TRANSLATORS: help output 6
-#: src/redshift.c:301
+#: src/redshift.c:312
#, c-format
msgid "Please report bugs to <%s>\n"
msgstr ""
-#: src/redshift.c:307
+#: src/redshift.c:318
msgid "Available adjustment methods:\n"
msgstr ""
-#: src/redshift.c:313
+#: src/redshift.c:324
msgid "Specify colon-separated options with `-m METHOD:OPTIONS'.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:316
+#: src/redshift.c:327
msgid "Try `-m METHOD:help' for help.\n"
msgstr ""
-#: src/redshift.c:322
+#: src/redshift.c:333
msgid "Available location providers:\n"
msgstr ""
-#: src/redshift.c:328
+#: src/redshift.c:339
msgid "Specify colon-separated options with`-l PROVIDER:OPTIONS'.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:331
+#: src/redshift.c:342
msgid "Try `-l PROVIDER:help' for help.\n"
msgstr ""
-#: src/redshift.c:343 src/redshift.c:396
+#: src/redshift.c:354 src/redshift.c:407
#, fuzzy, c-format
msgid "Initialization of %s failed.\n"
msgstr "Fejl under klargøring af RANDR.\n"
-#: src/redshift.c:365 src/redshift.c:418
+#: src/redshift.c:376 src/redshift.c:429
#, c-format
msgid "Failed to set %s option.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:368
+#: src/redshift.c:379
#, fuzzy, c-format
msgid "Try `-l %s:help' for more information.\n"
msgstr "Prøv `-h' for mere information.\n"
-#: src/redshift.c:380
+#: src/redshift.c:391
#, c-format
msgid "Failed to start provider %s.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:421
+#: src/redshift.c:432
#, fuzzy, c-format
msgid "Try -m %s:help' for more information.\n"
msgstr "Prøv `-h' for mere information.\n"
-#: src/redshift.c:433
+#: src/redshift.c:444
#, c-format
msgid "Failed to start adjustment method %s.\n"
msgstr ""
-#: src/redshift.c:490
+#: src/redshift.c:501
msgid "Malformed gamma argument.\n"
msgstr "Fejl i gamma-argument.\n"
-#: src/redshift.c:492 src/redshift.c:607 src/redshift.c:619
+#: src/redshift.c:503 src/redshift.c:618 src/redshift.c:633
msgid "Try `-h' for more information.\n"
msgstr "Prøv `-h' for mere information.\n"
-#: src/redshift.c:546
+#: src/redshift.c:557
#, fuzzy, c-format
msgid "Unknown location provider `%s'.\n"
msgstr "Ukendt metode `%s'.\n"
#. TRANSLATORS: This refers to the method
#. used to adjust colors e.g VidMode
-#: src/redshift.c:584
+#: src/redshift.c:595
#, c-format
msgid "Unknown method `%s'.\n"
msgstr "Ukendt metode `%s'.\n"
-#: src/redshift.c:605
+#: src/redshift.c:616
msgid "Malformed temperature argument.\n"
msgstr "Fejl i temperaturargument.\n"
-#: src/redshift.c:640
+#: src/redshift.c:659
#, fuzzy
msgid "Trying other provider...\n"
msgstr "Prøver anden metode...\n"
-#: src/redshift.c:650
+#: src/redshift.c:671
msgid "No more location providers to try.\n"
msgstr ""
-#: src/redshift.c:662
+#: src/redshift.c:685
msgid "Unable to get location from provider.\n"
msgstr ""
#. TRANSLATORS: Append degree symbols if possible.
-#: src/redshift.c:670
+#: src/redshift.c:694
#, c-format
msgid "Location: %f, %f\n"
msgstr "Placering: %f°, %f°\n"
-#: src/redshift.c:677
+#: src/redshift.c:701
#, c-format
msgid "Latitude must be between %.1f and %.1f.\n"
msgstr "Breddegrad skal være mellem %.1f° og %.1f°.\n"
-#: src/redshift.c:686
+#: src/redshift.c:710
#, c-format
msgid "Longitude must be between %.1f and %.1f.\n"
msgstr "Længdegrad skal være mellem %.1f° og %.1f°.\n"
-#: src/redshift.c:694 src/redshift.c:702
+#: src/redshift.c:719 src/redshift.c:727
#, c-format
msgid "Temperature must be between %uK and %uK.\n"
msgstr "Temperatur skal være mellem %uK og %uK.\n"
-#: src/redshift.c:712
+#: src/redshift.c:737
#, c-format
msgid "Gamma value must be between %.1f and %.1f.\n"
msgstr "Gamma-værdi skal være mellem %.1f og %.1f.\n"
-#: src/redshift.c:718
+#: src/redshift.c:743
#, c-format
msgid "Gamma: %.3f, %.3f, %.3f\n"
msgstr "Gamma: %.3f, %.3f, %.3f\n"
-#: src/redshift.c:736
+#: src/redshift.c:761
msgid "Trying other method...\n"
msgstr "Prøver anden metode...\n"
-#: src/redshift.c:746
+#: src/redshift.c:771
msgid "No more methods to try.\n"
msgstr ""
-#: src/redshift.c:756 src/redshift.c:863
+#: src/redshift.c:783 src/redshift.c:904
#, fuzzy
msgid "Unable to read system time.\n"
msgstr "Kan ikke genskabe CRTC %i\n"
#. TRANSLATORS: Append degree symbol if possible.
-#: src/redshift.c:765
+#: src/redshift.c:792
#, c-format
msgid "Solar elevation: %f\n"
msgstr "Solhøjde: %f°\n"
-#: src/redshift.c:772 src/redshift.c:930
+#: src/redshift.c:799 src/redshift.c:971
#, c-format
msgid "Color temperature: %uK\n"
msgstr "Farvetemperatur: %uK\n"
-#: src/redshift.c:777 src/redshift.c:938
+#: src/redshift.c:804 src/redshift.c:815 src/redshift.c:979
msgid "Temperature adjustment failed.\n"
msgstr "Fejl ved justering af temperatur.\n"
diff --git a/po/redshift.pot b/po/redshift.pot
index 6eceb84..5be555f 100644
--- a/po/redshift.pot
+++ b/po/redshift.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: redshift 1.3\n"
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/redshift\n"
-"POT-Creation-Date: 2010-06-10 13:27+0200\n"
+"POT-Creation-Date: 2010-06-10 20:13+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,17 +16,17 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/redshift.c:233
+#: src/redshift.c:243
#, c-format
msgid "Period: Night\n"
msgstr ""
-#: src/redshift.c:240
+#: src/redshift.c:250
#, c-format
msgid "Period: Transition (%.2f%% day)\n"
msgstr ""
-#: src/redshift.c:244
+#: src/redshift.c:254
#, c-format
msgid "Period: Daytime\n"
msgstr ""
@@ -36,20 +36,20 @@ msgstr ""
#. DAY is temperature at daytime,
#. NIGHT is temperature at night
#. no-wrap
-#: src/redshift.c:259
+#: src/redshift.c:269
#, c-format
msgid "Usage: %s -l LAT:LON -t DAY:NIGHT [OPTIONS...]\n"
msgstr ""
#. TRANSLATORS: help output 2
#. no-wrap
-#: src/redshift.c:265
+#: src/redshift.c:275
msgid "Set color temperature of display according to time of day.\n"
msgstr ""
#. TRANSLATORS: help output 3
#. no-wrap
-#: src/redshift.c:271
+#: src/redshift.c:281
msgid ""
" -h\t\tDisplay this help message\n"
" -v\t\tVerbose output\n"
@@ -58,7 +58,7 @@ msgstr ""
#. TRANSLATORS: help output 4
#. `list' must not be translated
#. no-wrap
-#: src/redshift.c:278
+#: src/redshift.c:288
msgid ""
" -g R:G:B\tAdditional gamma correction to apply\n"
" -l LAT:LON\tYour current location\n"
@@ -67,12 +67,13 @@ msgid ""
" -m METHOD\tMethod to use to set color temperature\n"
" \t\t(Type `list' to see available methods)\n"
" -o\t\tOne shot mode (do not continously adjust color temperature)\n"
+" -x\t\tReset mode (remove adjustment from screen)\n"
" -r\t\tDisable temperature transitions\n"
" -t DAY:NIGHT\tColor temperature to set at daytime/night\n"
msgstr ""
#. TRANSLATORS: help output 5
-#: src/redshift.c:293
+#: src/redshift.c:304
#, c-format
msgid ""
"Default values:\n"
@@ -82,160 +83,160 @@ msgid ""
msgstr ""
#. TRANSLATORS: help output 6
-#: src/redshift.c:301
+#: src/redshift.c:312
#, c-format
msgid "Please report bugs to <%s>\n"
msgstr ""
-#: src/redshift.c:307
+#: src/redshift.c:318
msgid "Available adjustment methods:\n"
msgstr ""
-#: src/redshift.c:313
+#: src/redshift.c:324
msgid "Specify colon-separated options with `-m METHOD:OPTIONS'.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:316
+#: src/redshift.c:327
msgid "Try `-m METHOD:help' for help.\n"
msgstr ""
-#: src/redshift.c:322
+#: src/redshift.c:333
msgid "Available location providers:\n"
msgstr ""
-#: src/redshift.c:328
+#: src/redshift.c:339
msgid "Specify colon-separated options with`-l PROVIDER:OPTIONS'.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:331
+#: src/redshift.c:342
msgid "Try `-l PROVIDER:help' for help.\n"
msgstr ""
-#: src/redshift.c:343 src/redshift.c:396
+#: src/redshift.c:354 src/redshift.c:407
#, c-format
msgid "Initialization of %s failed.\n"
msgstr ""
-#: src/redshift.c:365 src/redshift.c:418
+#: src/redshift.c:376 src/redshift.c:429
#, c-format
msgid "Failed to set %s option.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:368
+#: src/redshift.c:379
#, c-format
msgid "Try `-l %s:help' for more information.\n"
msgstr ""
-#: src/redshift.c:380
+#: src/redshift.c:391
#, c-format
msgid "Failed to start provider %s.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:421
+#: src/redshift.c:432
#, c-format
msgid "Try -m %s:help' for more information.\n"
msgstr ""
-#: src/redshift.c:433
+#: src/redshift.c:444
#, c-format
msgid "Failed to start adjustment method %s.\n"
msgstr ""
-#: src/redshift.c:490
+#: src/redshift.c:501
msgid "Malformed gamma argument.\n"
msgstr ""
-#: src/redshift.c:492 src/redshift.c:607 src/redshift.c:619
+#: src/redshift.c:503 src/redshift.c:618 src/redshift.c:633
msgid "Try `-h' for more information.\n"
msgstr ""
-#: src/redshift.c:546
+#: src/redshift.c:557
#, c-format
msgid "Unknown location provider `%s'.\n"
msgstr ""
#. TRANSLATORS: This refers to the method
#. used to adjust colors e.g VidMode
-#: src/redshift.c:584
+#: src/redshift.c:595
#, c-format
msgid "Unknown method `%s'.\n"
msgstr ""
-#: src/redshift.c:605
+#: src/redshift.c:616
msgid "Malformed temperature argument.\n"
msgstr ""
-#: src/redshift.c:640
+#: src/redshift.c:659
msgid "Trying other provider...\n"
msgstr ""
-#: src/redshift.c:650
+#: src/redshift.c:671
msgid "No more location providers to try.\n"
msgstr ""
-#: src/redshift.c:662
+#: src/redshift.c:685
msgid "Unable to get location from provider.\n"
msgstr ""
#. TRANSLATORS: Append degree symbols if possible.
-#: src/redshift.c:670
+#: src/redshift.c:694
#, c-format
msgid "Location: %f, %f\n"
msgstr ""
-#: src/redshift.c:677
+#: src/redshift.c:701
#, c-format
msgid "Latitude must be between %.1f and %.1f.\n"
msgstr ""
-#: src/redshift.c:686
+#: src/redshift.c:710
#, c-format
msgid "Longitude must be between %.1f and %.1f.\n"
msgstr ""
-#: src/redshift.c:694 src/redshift.c:702
+#: src/redshift.c:719 src/redshift.c:727
#, c-format
msgid "Temperature must be between %uK and %uK.\n"
msgstr ""
-#: src/redshift.c:712
+#: src/redshift.c:737
#, c-format
msgid "Gamma value must be between %.1f and %.1f.\n"
msgstr ""
-#: src/redshift.c:718
+#: src/redshift.c:743
#, c-format
msgid "Gamma: %.3f, %.3f, %.3f\n"
msgstr ""
-#: src/redshift.c:736
+#: src/redshift.c:761
msgid "Trying other method...\n"
msgstr ""
-#: src/redshift.c:746
+#: src/redshift.c:771
msgid "No more methods to try.\n"
msgstr ""
-#: src/redshift.c:756 src/redshift.c:863
+#: src/redshift.c:783 src/redshift.c:904
msgid "Unable to read system time.\n"
msgstr ""
#. TRANSLATORS: Append degree symbol if possible.
-#: src/redshift.c:765
+#: src/redshift.c:792
#, c-format
msgid "Solar elevation: %f\n"
msgstr ""
-#: src/redshift.c:772 src/redshift.c:930
+#: src/redshift.c:799 src/redshift.c:971
#, c-format
msgid "Color temperature: %uK\n"
msgstr ""
-#: src/redshift.c:777 src/redshift.c:938
+#: src/redshift.c:804 src/redshift.c:815 src/redshift.c:979
msgid "Temperature adjustment failed.\n"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index c7c92cc..2afb04a 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: redshift\n"
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/redshift\n"
-"POT-Creation-Date: 2010-06-10 13:27+0200\n"
+"POT-Creation-Date: 2010-06-10 20:13+0200\n"
"PO-Revision-Date: 2010-02-02 09:20+0000\n"
"Last-Translator: Gregory Petrosyan <gregory.petrosyan@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
@@ -17,17 +17,17 @@ msgstr ""
"X-Launchpad-Export-Date: 2010-02-13 05:02+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: src/redshift.c:233
+#: src/redshift.c:243
#, c-format
msgid "Period: Night\n"
msgstr "Период: Ночь\n"
-#: src/redshift.c:240
+#: src/redshift.c:250
#, c-format
msgid "Period: Transition (%.2f%% day)\n"
msgstr "Период: Переходный (%.2f%% дневной)\n"
-#: src/redshift.c:244
+#: src/redshift.c:254
#, c-format
msgid "Period: Daytime\n"
msgstr "Период: День\n"
@@ -37,20 +37,20 @@ msgstr "Период: День\n"
#. DAY is temperature at daytime,
#. NIGHT is temperature at night
#. no-wrap
-#: src/redshift.c:259
+#: src/redshift.c:269
#, c-format
msgid "Usage: %s -l LAT:LON -t DAY:NIGHT [OPTIONS...]\n"
msgstr "Использование: %s -l ШИР:ДОЛ -t ДЕНЬ:НОЧЬ [ОПЦИИ...]\n"
#. TRANSLATORS: help output 2
#. no-wrap
-#: src/redshift.c:265
+#: src/redshift.c:275
msgid "Set color temperature of display according to time of day.\n"
msgstr "Установить цветовую температуру в соответствии со временем суток.\n"
#. TRANSLATORS: help output 3
#. no-wrap
-#: src/redshift.c:271
+#: src/redshift.c:281
msgid ""
" -h\t\tDisplay this help message\n"
" -v\t\tVerbose output\n"
@@ -61,7 +61,7 @@ msgstr ""
#. TRANSLATORS: help output 4
#. `list' must not be translated
#. no-wrap
-#: src/redshift.c:278
+#: src/redshift.c:288
#, fuzzy
msgid ""
" -g R:G:B\tAdditional gamma correction to apply\n"
@@ -71,6 +71,7 @@ msgid ""
" -m METHOD\tMethod to use to set color temperature\n"
" \t\t(Type `list' to see available methods)\n"
" -o\t\tOne shot mode (do not continously adjust color temperature)\n"
+" -x\t\tReset mode (remove adjustment from screen)\n"
" -r\t\tDisable temperature transitions\n"
" -t DAY:NIGHT\tColor temperature to set at daytime/night\n"
msgstr ""
@@ -83,7 +84,7 @@ msgstr ""
" -t ДЕНЬ:НОЧЬ\tЦветовая температура для ночного/дневного времени\n"
#. TRANSLATORS: help output 5
-#: src/redshift.c:293
+#: src/redshift.c:304
#, c-format
msgid ""
"Default values:\n"
@@ -93,162 +94,162 @@ msgid ""
msgstr ""
#. TRANSLATORS: help output 6
-#: src/redshift.c:301
+#: src/redshift.c:312
#, c-format
msgid "Please report bugs to <%s>\n"
msgstr ""
-#: src/redshift.c:307
+#: src/redshift.c:318
msgid "Available adjustment methods:\n"
msgstr ""
-#: src/redshift.c:313
+#: src/redshift.c:324
msgid "Specify colon-separated options with `-m METHOD:OPTIONS'.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:316
+#: src/redshift.c:327
msgid "Try `-m METHOD:help' for help.\n"
msgstr ""
-#: src/redshift.c:322
+#: src/redshift.c:333
msgid "Available location providers:\n"
msgstr ""
-#: src/redshift.c:328
+#: src/redshift.c:339
msgid "Specify colon-separated options with`-l PROVIDER:OPTIONS'.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:331
+#: src/redshift.c:342
msgid "Try `-l PROVIDER:help' for help.\n"
msgstr ""
-#: src/redshift.c:343 src/redshift.c:396
+#: src/redshift.c:354 src/redshift.c:407
#, fuzzy, c-format
msgid "Initialization of %s failed.\n"
msgstr "Инициализация RANDR не удалась.\n"
-#: src/redshift.c:365 src/redshift.c:418
+#: src/redshift.c:376 src/redshift.c:429
#, c-format
msgid "Failed to set %s option.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:368
+#: src/redshift.c:379
#, fuzzy, c-format
msgid "Try `-l %s:help' for more information.\n"
msgstr "Воспользуйтесь «-h» для получения дополнительной информации.\n"
-#: src/redshift.c:380
+#: src/redshift.c:391
#, c-format
msgid "Failed to start provider %s.\n"
msgstr ""
#. TRANSLATORS: `help' must not be translated.
-#: src/redshift.c:421
+#: src/redshift.c:432
#, fuzzy, c-format
msgid "Try -m %s:help' for more information.\n"
msgstr "Воспользуйтесь «-h» для получения дополнительной информации.\n"
-#: src/redshift.c:433
+#: src/redshift.c:444
#, c-format
msgid "Failed to start adjustment method %s.\n"
msgstr ""
-#: src/redshift.c:490
+#: src/redshift.c:501
msgid "Malformed gamma argument.\n"
msgstr "Некорректная величина гаммы.\n"
-#: src/redshift.c:492 src/redshift.c:607 src/redshift.c:619
+#: src/redshift.c:503 src/redshift.c:618 src/redshift.c:633
msgid "Try `-h' for more information.\n"
msgstr "Воспользуйтесь «-h» для получения дополнительной информации.\n"
-#: src/redshift.c:546
+#: src/redshift.c:557
#, fuzzy, c-format
msgid "Unknown location provider `%s'.\n"
msgstr "Неизвестный метод «%s».\n"
#. TRANSLATORS: This refers to the method
#. used to adjust colors e.g VidMode
-#: src/redshift.c:584
+#: src/redshift.c:595
#, c-format
msgid "Unknown method `%s'.\n"
msgstr "Неизвестный метод «%s».\n"
-#: src/redshift.c:605
+#: src/redshift.c:616
msgid "Malformed temperature argument.\n"
msgstr "Некорректное значение температуры.\n"
-#: src/redshift.c:640
+#: src/redshift.c:659
#, fuzzy
msgid "Trying other provider...\n"
msgstr "Пробую другой метод...\n"
-#: src/redshift.c:650
+#: src/redshift.c:671
msgid "No more location providers to try.\n"
msgstr ""
-#: src/redshift.c:662
+#: src/redshift.c:685
msgid "Unable to get location from provider.\n"
msgstr ""
#. TRANSLATORS: Append degree symbols if possible.
-#: src/redshift.c:670
+#: src/redshift.c:694
#, c-format
msgid "Location: %f, %f\n"
msgstr "Местоположение: %f°, %f°\n"
-#: src/redshift.c:677
+#: src/redshift.c:701
#, c-format
msgid "Latitude must be between %.1f and %.1f.\n"
msgstr "Широта должна быть между %.1f и %.1f.\n"
-#: src/redshift.c:686
+#: src/redshift.c:710
#, c-format
msgid "Longitude must be between %.1f and %.1f.\n"
msgstr "Долгота должна быть между %.1f и %.1f.\n"
-#: src/redshift.c:694 src/redshift.c:702
+#: src/redshift.c:719 src/redshift.c:727
#, c-format
msgid "Temperature must be between %uK and %uK.\n"
msgstr "Температура должна быть между %uK и %uK.\n"
-#: src/redshift.c:712
+#: src/redshift.c:737
#, c-format
msgid "Gamma value must be between %.1f and %.1f.\n"
msgstr "Гамма должна быть между %.1f и %.1f.\n"
-#: src/redshift.c:718
+#: src/redshift.c:743
#, c-format
msgid "Gamma: %.3f, %.3f, %.3f\n"
msgstr "Гамма: %.3f, %.3f, %.3f\n"
-#: src/redshift.c:736
+#: src/redshift.c:761
msgid "Trying other method...\n"
msgstr "Пробую другой метод...\n"
-#: src/redshift.c:746
+#: src/redshift.c:771
msgid "No more methods to try.\n"
msgstr ""
-#: src/redshift.c:756 src/redshift.c:863
+#: src/redshift.c:783 src/redshift.c:904
#, fuzzy
msgid "Unable to read system time.\n"
msgstr "Не удается восстановить CRTC %i\n"
#. TRANSLATORS: Append degree symbol if possible.
-#: src/redshift.c:765
+#: src/redshift.c:792
#, c-format
msgid "Solar elevation: %f\n"
msgstr "Высота Солнца над горизонтом: %f°\n"
-#: src/redshift.c:772 src/redshift.c:930
+#: src/redshift.c:799 src/redshift.c:971
#, c-format
msgid "Color temperature: %uK\n"
msgstr "Цветовая температура: %uK\n"
-#: src/redshift.c:777 src/redshift.c:938
+#: src/redshift.c:804 src/redshift.c:815 src/redshift.c:979
msgid "Temperature adjustment failed.\n"
msgstr "Корректировка цветовой температуры не удалась.\n"
diff --git a/src/redshift.c b/src/redshift.c
index bb418c7..18cc2c5 100644
--- a/src/redshift.c
+++ b/src/redshift.c
@@ -128,7 +128,7 @@ static const gamma_method_t gamma_methods[] = {
(gamma_method_set_temperature_func *)w32gdi_set_temperature
},
#endif
- { NULL, NULL, NULL, NULL, NULL }
+ { NULL }
};
@@ -169,7 +169,7 @@ static const location_provider_t location_providers[] = {
(location_provider_get_location_func *)
location_manual_get_location
},
- { NULL, NULL, NULL, NULL }
+ { NULL }
};
/* Bounds for parameters. */
@@ -187,6 +187,9 @@ static const location_provider_t location_providers[] = {
#define DEFAULT_NIGHT_TEMP 3700
#define DEFAULT_GAMMA 1.0
+/* The color temperature when no adjustment is applied. */
+#define NEUTRAL_TEMP 6500
+
/* Angular elevation of the sun at which the color temperature
transition period starts and ends (in degress).
Transition during twilight, and while the sun is lower than
@@ -194,6 +197,13 @@ static const location_provider_t location_providers[] = {
#define TRANSITION_LOW SOLAR_CIVIL_TWILIGHT_ELEV
#define TRANSITION_HIGH 3.0
+/* Program modes. */
+typedef enum {
+ PROGRAM_MODE_CONTINUAL,
+ PROGRAM_MODE_ONE_SHOT,
+ PROGRAM_MODE_RESET
+} program_mode_t;
+
#ifdef HAVE_SYS_SIGNAL_H
@@ -284,6 +294,7 @@ print_help(const char *program_name)
" \t\t(Type `list' to see available methods)\n"
" -o\t\tOne shot mode (do not continously adjust"
" color temperature)\n"
+ " -x\t\tReset mode (remove adjustment from screen)\n"
" -r\t\tDisable temperature transitions\n"
" -t DAY:NIGHT\tColor temperature to set at daytime/night\n"),
stdout);
@@ -466,13 +477,13 @@ main(int argc, char *argv[])
char *provider_args = NULL;
int transition = 1;
- int one_shot = 0;
+ program_mode_t mode = PROGRAM_MODE_CONTINUAL;
int verbose = 0;
char *s;
/* Parse arguments. */
int opt;
- while ((opt = getopt(argc, argv, "g:hl:m:ort:v")) != -1) {
+ while ((opt = getopt(argc, argv, "g:hl:m:ort:vx")) != -1) {
switch (opt) {
case 'g':
s = strchr(optarg, ':');
@@ -594,7 +605,7 @@ main(int argc, char *argv[])
}
break;
case 'o':
- one_shot = 1;
+ mode = PROGRAM_MODE_ONE_SHOT;
break;
case 'r':
transition = 0;
@@ -615,6 +626,9 @@ main(int argc, char *argv[])
case 'v':
verbose = 1;
break;
+ case 'x':
+ mode = PROGRAM_MODE_RESET;
+ break;
case '?':
fputs(_("Try `-h' for more information.\n"), stderr);
exit(EXIT_FAILURE);
@@ -626,66 +640,77 @@ main(int argc, char *argv[])
try all providers until one that works is found. */
location_state_t location_state;
- if (provider != NULL) {
- /* Use provider specified on command line. */
- r = provider_try_start(provider, &location_state,
- provider_args);
- if (r < 0) exit(EXIT_FAILURE);
- } else {
- /* Try all providers, use the first that works. */
- for (int i = 0; location_providers[i].name != NULL; i++) {
- const location_provider_t *p = &location_providers[i];
- r = provider_try_start(p, &location_state, NULL);
- if (r < 0) {
- fputs(_("Trying other provider...\n"), stderr);
- continue;
- }
+ /* Location is not needed for reset mode. */
+ if (mode != PROGRAM_MODE_RESET) {
+ if (provider != NULL) {
+ /* Use provider specified on command line. */
+ r = provider_try_start(provider, &location_state,
+ provider_args);
+ if (r < 0) exit(EXIT_FAILURE);
+ } else {
+ /* Try all providers, use the first that works. */
+ for (int i = 0;
+ location_providers[i].name != NULL; i++) {
+ const location_provider_t *p =
+ &location_providers[i];
+ r = provider_try_start(p, &location_state,
+ NULL);
+ if (r < 0) {
+ fputs(_("Trying other provider...\n"),
+ stderr);
+ continue;
+ }
- provider = p;
- break;
- }
+ provider = p;
+ break;
+ }
- /* Failure if no providers were successful at this point. */
- if (provider == NULL) {
- fputs(_("No more location providers to try.\n"),
- stderr);
- exit(EXIT_FAILURE);
+ /* Failure if no providers were successful at this
+ point. */
+ if (provider == NULL) {
+ fputs(_("No more location providers"
+ " to try.\n"), stderr);
+ exit(EXIT_FAILURE);
+ }
}
}
float lat = NAN;
float lon = NAN;
- /* Get current location. */
- r = provider->get_location(&location_state, &lat, &lon);
- if (r < 0) {
- fputs(_("Unable to get location from provider.\n"), stderr);
- exit(EXIT_FAILURE);
- }
+ if (mode != PROGRAM_MODE_RESET) {
+ /* Get current location. */
+ r = provider->get_location(&location_state, &lat, &lon);
+ if (r < 0) {
+ fputs(_("Unable to get location from provider.\n"),
+ stderr);
+ exit(EXIT_FAILURE);
+ }
- provider->free(&location_state);
+ provider->free(&location_state);
- if (verbose) {
- /* TRANSLATORS: Append degree symbols if possible. */
- printf(_("Location: %f, %f\n"), lat, lon);
- }
+ if (verbose) {
+ /* TRANSLATORS: Append degree symbols if possible. */
+ printf(_("Location: %f, %f\n"), lat, lon);
+ }
- /* Latitude */
- if (lat < MIN_LAT || lat > MAX_LAT) {
- /* TRANSLATORS: Append degree symbols if possible. */
- fprintf(stderr,
- _("Latitude must be between %.1f and %.1f.\n"),
- MIN_LAT, MAX_LAT);
- exit(EXIT_FAILURE);
- }
+ /* Latitude */
+ if (lat < MIN_LAT || lat > MAX_LAT) {
+ /* TRANSLATORS: Append degree symbols if possible. */
+ fprintf(stderr,
+ _("Latitude must be between %.1f and %.1f.\n"),
+ MIN_LAT, MAX_LAT);
+ exit(EXIT_FAILURE);
+ }
- /* Longitude */
- if (lon < MIN_LON || lon > MAX_LON) {
- /* TRANSLATORS: Append degree symbols if possible. */
- fprintf(stderr,
- _("Longitude must be between %.1f and %.1f.\n"),
- MIN_LON, MAX_LON);
- exit(EXIT_FAILURE);
+ /* Longitude */
+ if (lon < MIN_LON || lon > MAX_LON) {
+ /* TRANSLATORS: Append degree symbols if possible. */
+ fprintf(stderr,
+ _("Longitude must be between"
+ " %.1f and %.1f.\n"), MIN_LON, MAX_LON);
+ exit(EXIT_FAILURE);
+ }
}
/* Color temperature at daytime */
@@ -748,7 +773,9 @@ main(int argc, char *argv[])
}
}
- if (one_shot) {
+ switch (mode) {
+ case PROGRAM_MODE_ONE_SHOT:
+ {
/* Current angular elevation of the sun */
double now;
r = systemtime_get_time(&now);
@@ -778,7 +805,21 @@ main(int argc, char *argv[])
method->free(&state);
exit(EXIT_FAILURE);
}
- } else {
+ }
+ break;
+ case PROGRAM_MODE_RESET:
+ {
+ /* Reset screen */
+ r = method->set_temperature(&state, NEUTRAL_TEMP, gamma);
+ if (r < 0) {
+ fputs(_("Temperature adjustment failed.\n"), stderr);
+ method->free(&state);
+ exit(EXIT_FAILURE);
+ }
+ }
+ break;
+ case PROGRAM_MODE_CONTINUAL:
+ {
/* Transition state */
double short_trans_end = 0;
int short_trans = 0;
@@ -955,6 +996,8 @@ main(int argc, char *argv[])
/* Restore saved gamma ramps */
method->restore(&state);
}
+ break;
+ }
/* Clean up gamma adjustment state */
method->free(&state);