diff --git a/scripts/__pycache__/kanshi-autoconfigcpython-314.pyc b/scripts/__pycache__/kanshi-autoconfigcpython-314.pyc index 1e92a2c..41663ee 100644 Binary files a/scripts/__pycache__/kanshi-autoconfigcpython-314.pyc and b/scripts/__pycache__/kanshi-autoconfigcpython-314.pyc differ diff --git a/scripts/kanshi-autoconfig b/scripts/kanshi-autoconfig index 2ffb149..23a780b 100755 --- a/scripts/kanshi-autoconfig +++ b/scripts/kanshi-autoconfig @@ -113,7 +113,7 @@ def detect_outputs(): outputs.append( { "name": name, - "internal": name.startswith(("eDP-", "LVDS-", "DSI-")), + "internal": is_internal_name(name), "width": chosen.get("width"), "height": chosen.get("height"), "rate": norm_rate(chosen.get("refresh") or chosen.get("rate")), @@ -340,6 +340,25 @@ def notify_send(summary, body=""): pass +def is_internal_name(name): + return name.startswith(("eDP-", "LVDS-", "DSI-")) + + +def enable_outputs(names): + """Ausgaenge per wlr-randr einschalten (stiller Vorab-Schritt).""" + if shutil.which("wlr-randr") is None: + return + for n in sorted(names): + try: + subprocess.run( + ["wlr-randr", "--output", n, "--on"], + timeout=15, check=False, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + ) + except Exception: + pass + + def find_kanshi_pids(): """PIDs laufender kanshi-Prozesse (ohne uns selbst), ohne pkill-Abhaengigkeit.""" pids, me = [], os.getpid() @@ -407,6 +426,16 @@ def run_watch(): if is_managed(CONFIG_PATH) and names != config_output_names(CONFIG_PATH): apply(merge_configs(safe_read(CONFIG_PATH), render(outputs))) elif names != last_set: + # Abdock-Sequenz: Waren Externe da und ist jetzt (auch) ein + # internes Panel da, erst das interne anzünden und kurz + # warten, BEVOR kanshi das volle Profil anwendet. Der + # kombinierte Commit (MST-Abbau + eDP-An in einem) hängt + # sonst die amdgpu-Pipeline (selbst die VT bleibt schwarz). + prev_extern = {o for o in last_set if not is_internal_name(o)} + new_intern = {o["name"] for o in outputs if o["internal"]} + if prev_extern and new_intern: + enable_outputs(new_intern) + time.sleep(2) profile = None if is_managed(CONFIG_PATH): if names != config_output_names(CONFIG_PATH):