mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-25 20:54:34 +00:00
Fix eww workspaces script crashing occasionally
This commit is contained in:
parent
03608c5b1c
commit
11ef5e8a1c
|
@ -131,7 +131,10 @@ def get_workspaces() -> list[OutputWorkspaceInfo]:
|
||||||
continue
|
continue
|
||||||
format_name = REMAPS.get(workspace["id"], workspace["name"])
|
format_name = REMAPS.get(workspace["id"], workspace["name"])
|
||||||
active = workspace["id"] in active_workspaces
|
active = workspace["id"] in active_workspaces
|
||||||
|
try:
|
||||||
mon_id = [monitor["id"] for monitor in monitors if monitor["name"] == workspace["monitor"]][0]
|
mon_id = [monitor["id"] for monitor in monitors if monitor["name"] == workspace["monitor"]][0]
|
||||||
|
except IndexError: # Sometimes workspace["monitor"] is "?", which doesn't match any monitor
|
||||||
|
mon_id = -1
|
||||||
out.append({**workspace, "format_name": format_name, "active": active, "monitor_id": mon_id})
|
out.append({**workspace, "format_name": format_name, "active": active, "monitor_id": mon_id})
|
||||||
|
|
||||||
out = fill_blank_workspaces(out)
|
out = fill_blank_workspaces(out)
|
||||||
|
|
Loading…
Reference in a new issue