Settings window #20

Merged
Zacharias-Brohn merged 83 commits from settingsWindow into main 2026-03-06 23:27:24 +01:00
Showing only changes of commit 2baf91552d - Show all commits
+32
View File
@@ -109,8 +109,40 @@ def generate(
ctx.update(term)
ctx["term"] = [term[f"term{i}"] for i in range(16)]
seq = make_sequences(
term=term,
foreground=ctx["m3onSurface"],
background=ctx["m3surface"],
)
ctx["sequences"] = seq
ctx["sequences_tmux"] = tmux_wrap_sequences(seq)
return ctx
def make_sequences(
*,
term: dict[str, str],
foreground: str,
background: str,
) -> str:
ESC = "\x1b"
ST = ESC + "\\"
parts: list[str] = []
for i in range(16):
parts.append(f"{ESC}]4;{i};{term[f'term{i}']}{ST}")
parts.append(f"{ESC}]10;{foreground}{ST}")
parts.append(f"{ESC}]11;{background}{ST}")
parts.append(f"{ESC}]12;{cursor}{ST}")
return "".join(parts)
def tmux_wrap_sequences(seq: str) -> str:
ESC = "\x1b"
return f"{ESC}Ptmux;{seq.replace(ESC, ESC+ESC)}{ESC}\\"
def terminal_palette_from_m3(colors: dict[str, str], mode: str) -> dict[str, str]:
def need(k: str) -> str:
try: