diff options
Diffstat (limited to '')
-rwxr-xr-x | src/__main__.py | 7 | ||||
-rw-r--r-- | src/adhoc.py | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/__main__.py b/src/__main__.py index e894221..39e880f 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -89,7 +89,12 @@ wait_period = 60 :float The number of seconds to wait before invoking `periodically` again ''' -monitor_controller = lambda : randr() +ttymode = not (('DISPLAY' in os.environ) and (':' in os.environ['DISPLAY'])) +''' +:bool Whether blueshift is running in a TTY, determined by the DISPLAY environment variable +''' + +monitor_controller = (lambda : drm()) if ttymode else (lambda : randr()) ''' :()→void Function used by Blueshift on exit to apply reset colour curves, if using preimplemented `reset` ''' diff --git a/src/adhoc.py b/src/adhoc.py index 4e130af..19ece22 100644 --- a/src/adhoc.py +++ b/src/adhoc.py @@ -74,7 +74,7 @@ def reduce(f, items): rc = f(rc, items[i]) return rc output = reduce(lambda x, y : x + y, [a.split(',') for a in output]) -monitor_controller = lambda : randr(*output) +monitor_controller = lambda : (drm if ttymode else randr)(*output) def apply(dayness, pureness): ''' |