[yambar] Put eDP-1 always first

This commit is contained in:
Midgard 2022-09-28 10:39:10 +02:00
parent 5b4ba8b12c
commit 59fb8e4c88
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -50,7 +50,10 @@ def subscribe(types: List[str]):
def format_workspaces(workspaces):
result = []
last_output = None
for i, ws in enumerate(sorted(workspaces, key=lambda x: (x["output"], x["num"], x["name"]))):
for i, ws in enumerate(sorted(
workspaces,
key=lambda x: ("" if x["output"] == "eDP-1" else x["output"], x["num"], x["name"])
)):
name = ws["name"]
new_monitor = last_output is not None and last_output != ws["output"]