mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 19:54:36 +00:00
Update remap rules for windowname script
This commit is contained in:
parent
2acdfac532
commit
47d070ce5e
|
@ -7,6 +7,7 @@ the window names. Window name and class are obtained from piped stdin, to preven
|
|||
needlessly keep restarting this program, which takes a while due to the interpreter starting
|
||||
overhead.
|
||||
"""
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
@ -64,7 +65,7 @@ REMAP_RULES: list[RemapRule] = [
|
|||
RemapRule(r"(?:\(\d+\) )?Discord \| (.+)", " {}", "vesktop"),
|
||||
RemapRule(r"(.+) - mpv", " {}", "mpv"),
|
||||
RemapRule(r"Stremio - (.+)", " Stremio - {}", r"(Stremio)|(com.stremio.stremio)"),
|
||||
RemapRule(r"Spotify", " Spotify", "Spotify"),
|
||||
RemapRule(r"Spotify((?: Premium)?)", " Spotify{}", "[Ss]potify"),
|
||||
RemapRule(r"pulsemixer", " Pulsemixer"),
|
||||
RemapRule(r"(.*)", " {}", "Pcmanfm"),
|
||||
RemapRule(r"(.*)", " {}", "pcmanfm-qt"),
|
||||
|
@ -81,7 +82,9 @@ def iter_window() -> Iterator[tuple[str, str]]:
|
|||
line = line.removesuffix("\n")
|
||||
els = line.split(",", maxsplit=1)
|
||||
if len(els) != 2:
|
||||
raise ValueError(f"Expected 2 arguments from stdin line (name, class), but got {len(els)}")
|
||||
raise ValueError(
|
||||
f"Expected 2 arguments from stdin line (name, class), but got {len(els)}"
|
||||
)
|
||||
yield els[1], els[0]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue