From 470f05150d3c69631644885cda62d3a90a1fbae8 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sun, 7 Aug 2022 10:32:28 +0200 Subject: [PATCH] [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 --- bumblebee_status/modules/core/redshift.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bumblebee_status/modules/core/redshift.py b/bumblebee_status/modules/core/redshift.py index d50463f..c5835cd 100644 --- a/bumblebee_status/modules/core/redshift.py +++ b/bumblebee_status/modules/core/redshift.py @@ -12,6 +12,7 @@ Parameters: * redshift.lat : latitude 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.adjust: set this to 'true' (defaults to false) to let bumblebee-status adjust color temperature, instead of just showing the current settings """ import re @@ -38,7 +39,13 @@ def get_redshift_value(module): if location == "manual" and (lat is None or lon is None): 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": command.extend(["-l", "{}:{}".format(lat, lon)]) if location == "geoclue2":