From: Phillip Berndt Date: Fri, 20 Jan 2017 13:59:43 +0000 (+0100) Subject: Set AUTORANDR_BATCH_PID environment variable in batch invocations X-Git-Tag: 1.1~6^2~2 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=c583fb43899ccf1744661f66e489e0b082dd7b16 Set AUTORANDR_BATCH_PID environment variable in batch invocations --- diff --git a/autorandr.py b/autorandr.py index 5082ebd..670865a 100755 --- a/autorandr.py +++ b/autorandr.py @@ -843,6 +843,9 @@ def dispatch_call_to_sessions(argv): process_environ[name] = value display = process_environ["DISPLAY"] if "DISPLAY" in process_environ else None + # To allow scripts to detect batch invocation (especially useful for predetect) + process_environ["AUTORANDR_BATCH_PID"] = os.getpid() + if display and display not in X11_displays_done: try: pwent = pwd.getpwuid(uid)