[module/redshift] allow adjusting the color temperature
add a boolean flag ("adjust") to redshift that allows the user to have bumblebee-status actually perform the color adjustment (by invoking redshift in "one-shot" node). Note that this only updates the color value each time the redshift module is updated (every 10s, by default), and likely will collide with any running redshift process. fixes #908
This commit is contained in:
parent
6af47dc506
commit
470f05150d
1 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,7 @@ Parameters:
|
||||||
* redshift.lat : latitude if location is set to 'manual'
|
* redshift.lat : latitude if location is set to 'manual'
|
||||||
* redshift.lon : longitude if location is set to 'manual'
|
* redshift.lon : longitude if location is set to 'manual'
|
||||||
* redshift.show_transition: information about the transitions (x% day) defaults to True
|
* redshift.show_transition: information about the transitions (x% day) defaults to True
|
||||||
|
* redshift.adjust: set this to 'true' (defaults to false) to let bumblebee-status adjust color temperature, instead of just showing the current settings
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
@ -38,7 +39,13 @@ def get_redshift_value(module):
|
||||||
if location == "manual" and (lat is None or lon is None):
|
if location == "manual" and (lat is None or lon is None):
|
||||||
location = "geoclue2"
|
location = "geoclue2"
|
||||||
|
|
||||||
command = ["redshift", "-p"]
|
command = ["redshift"]
|
||||||
|
|
||||||
|
if util.format.asbool(module.parameter("adjust", "false")) == True:
|
||||||
|
command.extend(["-o", "-v"])
|
||||||
|
else:
|
||||||
|
command.append("-p")
|
||||||
|
|
||||||
if location == "manual":
|
if location == "manual":
|
||||||
command.extend(["-l", "{}:{}".format(lat, lon)])
|
command.extend(["-l", "{}:{}".format(lat, lon)])
|
||||||
if location == "geoclue2":
|
if location == "geoclue2":
|
||||||
|
|
Loading…
Reference in a new issue