Set AUTORANDR_BATCH_PID environment variable in batch invocations

This commit is contained in:
Phillip Berndt 2017-01-20 14:59:43 +01:00
parent 455809c32d
commit c583fb4389

View File

@ -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)