aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--po/be.po4
-rw-r--r--po/ca.po4
-rw-r--r--po/cs.po4
-rw-r--r--po/da.po4
-rw-r--r--po/de.po4
-rw-r--r--po/el.po2
-rw-r--r--po/en_GB.po4
-rw-r--r--po/eo.po2
-rw-r--r--po/es.po4
-rw-r--r--po/eu.po4
-rw-r--r--po/fi.po2
-rw-r--r--po/fr.po4
-rw-r--r--po/gl.po2
-rw-r--r--po/he.po2
-rw-r--r--po/hi.po2
-rw-r--r--po/hr.po2
-rw-r--r--po/hu.po2
-rw-r--r--po/it.po2
-rw-r--r--po/ja.po4
-rw-r--r--po/lt.po2
-rw-r--r--po/nb.po2
-rw-r--r--po/nl.po4
-rw-r--r--po/oc.po2
-rw-r--r--po/pl.po2
-rw-r--r--po/pt.po2
-rw-r--r--po/pt_BR.po2
-rw-r--r--po/redshift.pot2
-rw-r--r--po/ro.po2
-rw-r--r--po/ru.po2
-rw-r--r--po/sr.po2
-rw-r--r--po/sv.po2
-rw-r--r--po/tr.po2
-rw-r--r--po/uk.po4
-rw-r--r--po/zh_CN.po4
-rw-r--r--po/zh_TW.po4
-rw-r--r--src/common.h73
-rw-r--r--src/options.c171
-rw-r--r--src/redshift.c32
38 files changed, 206 insertions, 168 deletions
diff --git a/po/be.po b/po/be.po
index 4bdd432..3ff555d 100644
--- a/po/be.po
+++ b/po/be.po
@@ -399,13 +399,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"Нейтральная тэмпература %uK. Ужыванне гэтага значэння не будзе\n"
+"Нейтральная тэмпература %luK. Ужыванне гэтага значэння не будзе\n"
"ўплываць на каляровую тэмпературу дысплея.\n"
"Каляровая тэмпература вышэй за гэтую дае\n"
"больш сіняе святло, ніжэй за гэтую дае\n"
diff --git a/po/ca.po b/po/ca.po
index 6fbede0..330c44d 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -403,13 +403,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"La temperatura neutra és %u K. L'ús d'aquest valor no canviarà la\n"
+"La temperatura neutra és %lu K. L'ús d'aquest valor no canviarà la\n"
"temperatura de color de la pantalla. Establir un valor més alt\n"
"donarà com a resultat un to més blavós i establir un valor més\n"
"baix donarà com a resultat un to més vermellós.\n"
diff --git a/po/cs.po b/po/cs.po
index 4089956..4825cd1 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -402,13 +402,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"Neutrální teplota barev je %uK. Použití této hodnoty nezmění teplotu barev\n"
+"Neutrální teplota barev je %luK. Použití této hodnoty nezmění teplotu barev\n"
"displeje. Nastavení teploty barev na hodnotu vyšší než tato vyústí ve více\n"
"modrého světla a nastavení na nižší hodnotu ve více červeného světla.\n"
diff --git a/po/da.po b/po/da.po
index 44306e6..a44ba6e 100644
--- a/po/da.po
+++ b/po/da.po
@@ -400,13 +400,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"Den neutrale temperatur er %uK. Når denne værdi benyttes vil der\n"
+"Den neutrale temperatur er %luK. Når denne værdi benyttes vil der\n"
"ikke ske nogen ændringer af farvetemperaturen. En højere værdi vil\n"
"resultere i mere blåt lås, mens en lavere værdi vil resultere\n"
"i mere rødt lys.\n"
diff --git a/po/de.po b/po/de.po
index 04fa90e..937d9d9 100644
--- a/po/de.po
+++ b/po/de.po
@@ -400,13 +400,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"Die neutrale Temperatur ist %uK. Benutzung dieses Wertes ändert nicht\n"
+"Die neutrale Temperatur ist %luK. Benutzung dieses Wertes ändert nicht\n"
"die Farbtemperatur des Bildschirms. Das Einstellen der Farbtemperatur\n"
"auf einen höheren Wert als diesen führt zu mehr blauem Licht,\n"
"und ein kleinerer führt zu röterem Licht.\n"
diff --git a/po/el.po b/po/el.po
index 65b2e4d..9fa70f2 100644
--- a/po/el.po
+++ b/po/el.po
@@ -368,7 +368,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/en_GB.po b/po/en_GB.po
index 5b9ee8f..ca65d9d 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -399,13 +399,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"The neutral temperature is %uK. Using this value will not change the colour\n"
+"The neutral temperature is %luK. Using this value will not change the colour\n"
"temperature of the display. Setting the colour temperature to a value "
"higher\n"
"than this results in more blue light, and setting a lower value will result "
diff --git a/po/eo.po b/po/eo.po
index 8598dc4..e4264c3 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -369,7 +369,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/es.po b/po/es.po
index 57b2fc2..d8d7ba4 100644
--- a/po/es.po
+++ b/po/es.po
@@ -406,13 +406,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"La temperatura neutra es %u K. El uso de este valor no cambiará la\n"
+"La temperatura neutra es %lu K. El uso de este valor no cambiará la\n"
"temperatura de color de la pantalla. Establecer un valor más alto\n"
"dará como resultado un tono más azulado y establecer un valor más\n"
"bajo dará como resultado un tono más rojizo.\n"
diff --git a/po/eu.po b/po/eu.po
index 0010654..c5fc7ca 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -398,13 +398,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"Tenperatura neutrala %uK da. Balio hori erabiliz gero pantailaren kolore-\n"
+"Tenperatura neutrala %luK da. Balio hori erabiliz gero pantailaren kolore-\n"
"tenperatura ez da aldatuko. Kolore-tenperatura altuagoa ezarriz gero, tonoa "
"urdinagoa izango da eta baxuagoa ezarriz gero gorriagoa.\n"
diff --git a/po/fi.po b/po/fi.po
index 7b96e64..c885dc9 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -372,7 +372,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/fr.po b/po/fr.po
index 97ca0ad..dd04aab 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -407,13 +407,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"La température neutre est %uK. L'utilisation de cette valeur ne changera "
+"La température neutre est %luK. L'utilisation de cette valeur ne changera "
"pas\n"
"la température de couleur de l'affichage. Une valeur plus élevée que celle-"
"ci\n"
diff --git a/po/gl.po b/po/gl.po
index b82b206..048810d 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -368,7 +368,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/he.po b/po/he.po
index f4c9150..2a43ac5 100644
--- a/po/he.po
+++ b/po/he.po
@@ -370,7 +370,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/hi.po b/po/hi.po
index 1ad5f61..e3cd69b 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -371,7 +371,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/hr.po b/po/hr.po
index f312439..3bf444e 100644
--- a/po/hr.po
+++ b/po/hr.po
@@ -371,7 +371,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/hu.po b/po/hu.po
index 0de8b63..49893a4 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -385,7 +385,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/it.po b/po/it.po
index 47aa9b4..4ec29b0 100644
--- a/po/it.po
+++ b/po/it.po
@@ -385,7 +385,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/ja.po b/po/ja.po
index 611df7f..298915f 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -390,13 +390,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"ニュートラルな温度は %uK です。この値を用いると\n"
+"ニュートラルな温度は %luK です。この値を用いると\n"
"ディスプレイの色温度は変更されません。これよりも高い値を設定すると\n"
"青い光が増え、低い値を設定すると赤い光が増えます。\n"
diff --git a/po/lt.po b/po/lt.po
index 4bbca96..1cb69ef 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -379,7 +379,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/nb.po b/po/nb.po
index 1476c20..1c27be5 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -380,7 +380,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/nl.po b/po/nl.po
index bcfdcc2..e0a4c26 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -387,13 +387,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"De neutrale temperatuur is %uK. Het gebruik van deze waarde zal de\n"
+"De neutrale temperatuur is %luK. Het gebruik van deze waarde zal de\n"
"kleurtemperatuur van het scherm niet veranderen. Het instellen van de\n"
"kleurtemperatuur op een hogere waarde zal meer blauw licht geven,\n"
"en het instellen van een lagere waarde zal meer rood licht veroorzaken.\n"
diff --git a/po/oc.po b/po/oc.po
index bc5a617..15a8cc8 100644
--- a/po/oc.po
+++ b/po/oc.po
@@ -363,7 +363,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/pl.po b/po/pl.po
index 23eba5a..1d5ef09 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -381,7 +381,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/pt.po b/po/pt.po
index ba74cd2..50d57ba 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -373,7 +373,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index fc53d73..48f12e0 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -385,7 +385,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/redshift.pot b/po/redshift.pot
index 378cbb0..ef40e6d 100644
--- a/po/redshift.pot
+++ b/po/redshift.pot
@@ -364,7 +364,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/ro.po b/po/ro.po
index b6ca61d..57b1aab 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -367,7 +367,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/ru.po b/po/ru.po
index d67aee1..3c1d9ee 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -380,7 +380,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/sr.po b/po/sr.po
index 198ab48..35773a4 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -380,7 +380,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/sv.po b/po/sv.po
index ee3c83f..9537586 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -384,7 +384,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/tr.po b/po/tr.po
index b9425f3..32ad23e 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -368,7 +368,7 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
diff --git a/po/uk.po b/po/uk.po
index 25f0f9f..aa9387d 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -401,13 +401,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"Встановлена нейтральна температура - %uK. Використовуючи регулятор, \n"
+"Встановлена нейтральна температура - %luK. Використовуючи регулятор, \n"
"колірна температура екрану не змінюватиметься. Регулювання колірної \n"
"температури до вищого значення ніж цей результат до більш блакитного\n"
"світла, і зменшення значення буде відображати більше червоного світла.\n"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 46783ea..42546b3 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -386,12 +386,12 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
-msgstr "中性温度是 %uK. 使用这个值不会改变颜色\n"
+msgstr "中性温度是 %luK. 使用这个值不会改变颜色\n"
"显示器的温度。 将色温设置为更高的值\n"
"比这会导致更多的蓝光,设置较低的值会导致\n"
"更多的红灯。\n"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index fc34636..771048a 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -388,13 +388,13 @@ msgstr ""
#: ../src/options.c:201
#, c-format
msgid ""
-"The neutral temperature is %uK. Using this value will not change the color\n"
+"The neutral temperature is %luK. Using this value will not change the color\n"
"temperature of the display. Setting the color temperature to a value higher\n"
"than this results in more blue light, and setting a lower value will result "
"in\n"
"more red light.\n"
msgstr ""
-"中性色溫為 %uK 。\n"
+"中性色溫為 %luK 。\n"
"使用該值不會改變顯示器的色溫。\n"
"設置色溫值高於它,會導致更多的藍光。\n"
"設置色溫值低於它,會導致更多的紅光。\n"
diff --git a/src/common.h b/src/common.h
index 0b89b8f..22253e7 100644
--- a/src/common.h
+++ b/src/common.h
@@ -35,6 +35,7 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
+#include <limits.h>
#include <locale.h>
#include <math.h>
#include <signal.h>
@@ -117,16 +118,84 @@
/**
+ * Minimum valid latitude
+ */
+#define MIN_LATITUDE -90.0
+
+/**
+ * Maximum valid latitude
+ */
+#define MAX_LATITUDE 90.0
+
+/**
+ * Minimum valid longitude
+ */
+#define MIN_LONGITUDE -180.0
+
+/**
+ * Maximum valid longitude
+ */
+#define MAX_LONGITUDE 180.0
+
+/**
+ * Minimum allowed colour temperature
+ */
+#define MIN_TEMPERATURE ((unsigned long int)LIBRED_LOWEST_TEMPERATURE)
+
+/**
+ * Maximum allowed colour temperature
+ */
+#define MAX_TEMPERATURE ULONG_MAX
+
+/**
+ * Minimum allowed whitepoint brightness
+ */
+#define MIN_BRIGHTNESS 0.1
+
+/**
+ * Maximum allowed whitepoint brightness
+ */
+#define MAX_BRIGHTNESS 1.0
+
+/**
+ * Minimum allowed gamma
+ */
+#define MIN_GAMMA 0.1
+
+/**
+ * Maximum allowed gamma
+ */
+#define MAX_GAMMA 10.0
+
+
+/**
* The colour temperature corresponding to no effect
*/
-#define NEUTRAL_TEMP 6500U
+#define NEUTRAL_TEMPERATURE 6500UL
+
+/**
+ * The whitepoint brightness corresponding to
+ * full brightness (no effect)
+ */
+#define NEUTRAL_BRIGHTNESS 1.0
+
+/**
+ * The gamma corresponding to no effect (linear output level curve)
+ */
+#define NEUTRAL_GAMMA 1.0
+
/**
* Initialiser for `struct color_setting`
*
* Sets all values to their neutral values (no effects applied)
*/
-#define COLOR_SETTING_NEUTRAL ((struct color_setting){NEUTRAL_TEMP, 1.0, {1.0, 1.0, 1.0}})
+#define COLOR_SETTING_NEUTRAL\
+ ((struct color_setting){\
+ NEUTRAL_TEMPERATURE,\
+ NEUTRAL_BRIGHTNESS,\
+ {NEUTRAL_GAMMA, NEUTRAL_GAMMA, NEUTRAL_GAMMA}\
+ })
/**
diff --git a/src/options.c b/src/options.c
index 7a7fb01..8c9c766 100644
--- a/src/options.c
+++ b/src/options.c
@@ -27,10 +27,15 @@
#define TRANSITION_HIGH 3.0
/* Default values for parameters. */
-#define DEFAULT_DAY_TEMP 6500UL
-#define DEFAULT_NIGHT_TEMP 4500UL
-#define DEFAULT_BRIGHTNESS 1.0
-#define DEFAULT_GAMMA 1.0
+#define DEFAULT_DAY_TEMPERATURE 6500UL
+#define DEFAULT_NIGHT_TEMPERATURE 4500UL
+#define DEFAULT_BRIGHTNESS NEUTRAL_BRIGHTNESS
+#define DEFAULT_GAMMA NEUTRAL_GAMMA
+
+
+/* TODO missing translation */
+USAGE("[-b day:night] [-c file] [-g r:g:b] [-l latitude:longitude | -l provider[:options]]"
+ " [-m method[:options]] [-o | -O temperature | -t day:night | -x] [-pPrv] | -hV");
/* A brightness string contains either one floating point value,
@@ -104,19 +109,17 @@ parse_transition_time(const char *str, const char **end)
static int
parse_transition_range(const char *str, struct time_range *range)
{
- const char *next = NULL;
- int start_time;
- int end_time;
+ const char *next = NULL, *end = NULL;
+ int start_time, end_time;
start_time = parse_transition_time(str, &next);
- if (start_time < 0) return -1;
+ if (start_time < 0)
+ return -1;
- if (next[0] == '\0') {
+ if (!*next) {
end_time = start_time;
- } else if (next[0] == '-') {
- const char *end = NULL;
- next += 1;
- end_time = parse_transition_time(next, &end);
+ } else if (*next == '-') {
+ end_time = parse_transition_time(&next[1], &end);
if (end_time < 0 || *end)
return -1;
} else {
@@ -139,61 +142,56 @@ print_help(void)
NIGHT is temperature at night
no-wrap */
printf(_("Usage: %s -l LAT:LON -t DAY:NIGHT [OPTIONS...]\n"), argv0);
- fputs("\n", stdout);
+ printf("\n");
/* TRANSLATORS: help output 2
no-wrap */
- fputs(_("Set color temperature of display"
- " according to time of day.\n"), stdout);
- fputs("\n", stdout);
+ printf(_("Set color temperature of display according to time of day.\n"));
+ printf("\n");
/* TRANSLATORS: help output 3
no-wrap */
- fputs(_(" -h\t\tDisplay this help message\n"
- " -v\t\tVerbose output\n"
- " -V\t\tShow program version\n"), stdout);
- fputs("\n", stdout);
+ printf(_(" -h\t\tDisplay this help message\n"
+ " -v\t\tVerbose output\n"
+ " -V\t\tShow program version\n"));
+ printf("\n");
/* TRANSLATORS: help output 4
`list' must not be translated
no-wrap */
- fputs(_(" -b DAY:NIGHT\tScreen brightness to apply (between 0.1 and 1.0)\n"
- " -c FILE\tLoad settings from specified configuration file\n"
- " -g R:G:B\tAdditional gamma correction to apply\n"
- " -l LAT:LON\tYour current location\n"
- " -l PROVIDER\tSelect provider for automatic"
- " location updates\n"
- " \t\t(Type `list' to see available providers)\n"
- " -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 continuously adjust"
- " color temperature)\n"
- " -O TEMP\tOne shot manual mode (set color temperature)\n"
- " -p\t\tPrint mode (only print parameters and exit)\n"
- " -P\t\tReset existing gamma ramps before applying new"
- " color effect\n"
- " -x\t\tReset mode (remove adjustment from screen)\n"
- " -r\t\tDisable fading between color temperatures\n"
- " -t DAY:NIGHT\tColor temperature to set at daytime/night\n"),
- stdout);
- fputs("\n", stdout);
+ printf(_(" -b DAY:NIGHT\tScreen brightness to apply (between 0.1 and 1.0)\n"
+ " -c FILE\tLoad settings from specified configuration file\n"
+ " -g R:G:B\tAdditional gamma correction to apply\n"
+ " -l LAT:LON\tYour current location\n"
+ " -l PROVIDER\tSelect provider for automatic location updates\n"
+ " \t\t(Type `list' to see available providers)\n"
+ " -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 continuously adjust color temperature)\n"
+ " -O TEMP\tOne shot manual mode (set color temperature)\n"
+ " -p\t\tPrint mode (only print parameters and exit)\n"
+ " -P\t\tReset existing gamma ramps before applying new color effect\n"
+ " -x\t\tReset mode (remove adjustment from screen)\n"
+ " -r\t\tDisable fading between color temperatures\n"
+ " -t DAY:NIGHT\tColor temperature to set at daytime/night\n"));
+ printf("\n");
/* TRANSLATORS: help output 5 */
- printf(_("The neutral temperature is %uK. Using this value will not change "
- "the color\ntemperature of the display. Setting the color temperature "
- "to a value higher\nthan this results in more blue light, and setting "
- "a lower value will result in\nmore red light.\n"),
- NEUTRAL_TEMP);
+ printf(_("The neutral temperature is %luK. Using this value will not change the color\n"
+ "temperature of the display. Setting the color temperature to a value higher\n"
+ "than this results in more blue light, and setting a lower value will result in\n"
+ "more red light.\n"),
+ NEUTRAL_TEMPERATURE);
- fputs("\n", stdout);
+ printf("\n");
/* TRANSLATORS: help output 6 */
printf(_("Default values:\n\n"
" Daytime temperature: %luK\n"
" Night temperature: %luK\n"),
- DEFAULT_DAY_TEMP, DEFAULT_NIGHT_TEMP);
+ DEFAULT_DAY_TEMPERATURE, DEFAULT_NIGHT_TEMPERATURE);
- fputs("\n", stdout);
+ printf("\n");
}
/* Print list of adjustment methods. */
@@ -201,7 +199,6 @@ static void
print_method_list(void)
{
size_t i;
-
fputs(_("Available adjustment methods:\n"), stdout);
for (i = 0; gamma_methods[i]; i++)
printf(" %s\n", gamma_methods[i]->name);
@@ -217,11 +214,9 @@ static void
print_provider_list(void)
{
size_t i;
-
fputs(_("Available location providers:\n"), stdout);
- for (i = 0; location_providers[i]; i++) {
+ for (i = 0; location_providers[i]; i++)
printf(" %s\n", location_providers[i]->name);
- }
fputs("\n", stdout);
fputs(_("Specify colon-separated options with`-l PROVIDER:OPTIONS'.\n"), stdout);
@@ -230,7 +225,7 @@ print_provider_list(void)
}
/* Return the gamma method with the given name. */
-GCC_ONLY(__attribute__((__pure__)))
+GCC_ONLY(__attribute__((__pure__, __returns_nonnull__)))
static const struct gamma_method *
find_gamma_method(const char *name)
{
@@ -238,23 +233,22 @@ find_gamma_method(const char *name)
for (i = 0; gamma_methods[i]; i++)
if (!strcasecmp(name, gamma_methods[i]->name))
return gamma_methods[i];
- return NULL;
+ /* TRANSLATORS: This refers to the method used to adjust colors e.g. VidMode */
+ eprintf(_("Unknown adjustment method `%s'."), name);
}
/* Return location provider with the given name. */
-GCC_ONLY(__attribute__((__pure__)))
+GCC_ONLY(__attribute__((__pure__, __returns_nonnull__)))
static const struct location_provider *
find_location_provider(const char *name)
{
size_t i;
- for (i = 0; location_providers[i]; i++) {
+ for (i = 0; location_providers[i]; i++)
if (!strcasecmp(name, location_providers[i]->name))
return location_providers[i];
- }
- return NULL;
+ eprintf(_("Unknown location provider `%s'."), name);
}
-
/* Initialize options struct. */
void
options_init(struct options *options)
@@ -296,26 +290,26 @@ options_init(struct options *options)
options->verbose = 0;
}
-/* Parse a single option from the command-line. */
-static void
-parse_command_line_option(const char option, char *value, struct options *options)
+/* Parse command line arguments. */
+void
+options_parse_args(struct options *options, int argc, char *argv[])
{
const char *provider_name;
- char *s, *end;
+ char *s, *end, *value;
int r;
- switch (option) {
+ ARGBEGIN {
case 'b':
- parse_brightness_string(value, &options->scheme.day.brightness, &options->scheme.night.brightness);
+ parse_brightness_string(ARG(), &options->scheme.day.brightness, &options->scheme.night.brightness);
break;
case 'c':
free(options->config_filepath);
- options->config_filepath = estrdup(value);
+ options->config_filepath = estrdup(ARG());
break;
case 'g':
- r = parse_gamma_string(value, options->scheme.day.gamma);
+ r = parse_gamma_string(ARG(), options->scheme.day.gamma);
if (r < 0) {
weprintf(_("Malformed gamma argument."));
eprintf(_("Try `-h' for more information."));
@@ -330,6 +324,8 @@ parse_command_line_option(const char option, char *value, struct options *option
exit(0);
case 'l':
+ value = ARG();
+
/* Print list of providers if argument is `list' */
if (!strcasecmp(value, "list")) {
print_provider_list();
@@ -359,8 +355,6 @@ parse_command_line_option(const char option, char *value, struct options *option
/* Lookup provider from name. */
options->provider = find_location_provider(provider_name);
- if (!options->provider)
- eprintf(_("Unknown location provider `%s'."), provider_name);
/* Print provider help if arg is `help'. */
if (options->provider_args && !strcasecmp(options->provider_args, "help")) {
@@ -370,6 +364,8 @@ parse_command_line_option(const char option, char *value, struct options *option
break;
case 'm':
+ value = ARG();
+
/* Print list of methods if argument is `list' */
if (!strcasecmp(value, "list")) {
print_method_list();
@@ -385,10 +381,6 @@ parse_command_line_option(const char option, char *value, struct options *option
/* Find adjustment method by name. */
options->method = find_gamma_method(value);
- if (!options->method) {
- /* TRANSLATORS: This refers to the method used to adjust colors e.g. VidMode */
- eprintf(_("Unknown adjustment method `%s'."), value);
- }
/* Print method help if arg is `help'. */
if (options->method_args && !strcasecmp(options->method_args, "help")) {
@@ -403,7 +395,7 @@ parse_command_line_option(const char option, char *value, struct options *option
case 'O':
options->mode = PROGRAM_MODE_MANUAL;
- options->temp_set = atoi(value);
+ options->temp_set = atoi(ARG());
break;
case 'p':
@@ -419,6 +411,7 @@ parse_command_line_option(const char option, char *value, struct options *option
break;
case 't':
+ value = ARG();
s = strchr(value, ':');
if (!s) {
weprintf(_("Malformed temperature argument."));
@@ -443,17 +436,11 @@ parse_command_line_option(const char option, char *value, struct options *option
break;
default:
- eprintf(_("Try `-h' for more information."));
- }
-}
+ usage();
+ } ARGEND;
-/* Parse command line arguments. */
-void
-options_parse_args(struct options *options, int argc, char *argv[])
-{
- int opt;
- while ((opt = getopt(argc, argv, "b:c:g:hl:m:oO:pPrt:vVx")) != -1)
- parse_command_line_option(opt, optarg, options);
+ if (argc)
+ usage();
}
/* Parse a single key-value pair from the configuration file. */
@@ -505,17 +492,11 @@ parse_config_file_option(const char *key, const char *value, struct options *opt
if (options->preserve_gamma == 1)
options->preserve_gamma = !!atoi(value);
} else if (!strcasecmp(key, "adjustment-method")) {
- if (!options->method) {
+ if (!options->method)
options->method = find_gamma_method(value);
- if (!options->method)
- eprintf(_("Unknown adjustment method `%s'."), value);
- }
} else if (!strcasecmp(key, "location-provider")) {
- if (!options->provider) {
+ if (!options->provider)
options->provider = find_location_provider(value);
- if (!options->provider)
- eprintf(_("Unknown location provider `%s'."), value);
- }
} else if (!strcasecmp(key, "dawn-time")) {
if (options->scheme.dawn.start < 0) {
if (parse_transition_range(value, &options->scheme.dawn) < 0)
@@ -552,9 +533,9 @@ void
options_set_defaults(struct options *options)
{
if (!options->scheme.day.temperature)
- options->scheme.day.temperature = DEFAULT_DAY_TEMP;
+ options->scheme.day.temperature = DEFAULT_DAY_TEMPERATURE;
if (!options->scheme.night.temperature)
- options->scheme.night.temperature = DEFAULT_NIGHT_TEMP;
+ options->scheme.night.temperature = DEFAULT_NIGHT_TEMPERATURE;
if (isnan(options->scheme.day.brightness))
options->scheme.day.brightness = DEFAULT_BRIGHTNESS;
diff --git a/src/redshift.c b/src/redshift.c
index 451c4bf..7170a03 100644
--- a/src/redshift.c
+++ b/src/redshift.c
@@ -31,22 +31,10 @@ struct pollfd {
short events;
short revents;
};
-int poll(struct pollfd *fds, int nfds, int timeout) { abort(); return -1; }
+int poll(struct pollfd *fds, int nfds, int timeout) { abort(); }
#endif
-/* Bounds for parameters. */
-#define MIN_LAT -90.0
-#define MAX_LAT 90.0
-#define MIN_LON -180.0
-#define MAX_LON 180.0
-#define MIN_TEMP 1000UL
-#define MAX_TEMP 25000UL /* TODO README documents that there is no limit */
-#define MIN_BRIGHTNESS 0.1
-#define MAX_BRIGHTNESS 1.0
-#define MIN_GAMMA 0.1
-#define MAX_GAMMA 10.0
-
/* Duration of sleep between screen updates (milliseconds). */
#define SLEEP_DURATION 5000
#define SLEEP_DURATION_SHORT 100
@@ -391,14 +379,14 @@ gamma_is_valid(const double gamma[3])
static int
location_is_valid(const struct location *location)
{
- if (!WITHIN(MIN_LAT, location->lat, MAX_LAT)) {
+ if (!WITHIN(MIN_LATITUDE, location->lat, MAX_LATITUDE)) {
/* TRANSLATORS: Append degree symbols if possible. */
- weprintf(_("Latitude must be between %.1f and %.1f.\n"), MIN_LAT, MAX_LAT); /* TODO \n */
+ weprintf(_("Latitude must be between %.1f and %.1f.\n"), MIN_LATITUDE, MAX_LATITUDE); /* TODO \n */
return 0;
}
- if (!WITHIN(MIN_LON, location->lon, MAX_LON)) {
+ if (!WITHIN(MIN_LONGITUDE, location->lon, MAX_LONGITUDE)) {
/* TRANSLATORS: Append degree symbols if possible. */
- weprintf(_("Longitude must be between %.1f and %.1f.\n"), MIN_LON, MAX_LON); /* TODO \n */
+ weprintf(_("Longitude must be between %.1f and %.1f.\n"), MIN_LONGITUDE, MAX_LONGITUDE); /* TODO \n */
return 0;
}
return 1;
@@ -789,15 +777,15 @@ main(int argc, char *argv[])
}
/* Color temperature */
- if (!WITHIN(MIN_TEMP, options.scheme.day.temperature, MAX_TEMP) ||
- !WITHIN(MIN_TEMP, options.scheme.night.temperature, MAX_TEMP))
- eprintf(_("Temperature must be between %luK and %luK."), MIN_TEMP, MAX_TEMP);
+ if (!WITHIN(MIN_TEMPERATURE, options.scheme.day.temperature, MAX_TEMPERATURE) ||
+ !WITHIN(MIN_TEMPERATURE, options.scheme.night.temperature, MAX_TEMPERATURE))
+ eprintf(_("Temperature must be between %luK and %luK."), MIN_TEMPERATURE, MAX_TEMPERATURE);
}
if (options.mode == PROGRAM_MODE_MANUAL) {
/* Check color temperature to be set */
- if (!WITHIN(MIN_TEMP, options.temp_set, MAX_TEMP))
- eprintf(_("Temperature must be between %luK and %luK."), MIN_TEMP, MAX_TEMP);
+ if (!WITHIN(MIN_TEMPERATURE, options.temp_set, MAX_TEMPERATURE))
+ eprintf(_("Temperature must be between %luK and %luK."), MIN_TEMPERATURE, MAX_TEMPERATURE);
}
/* Brightness */