frobar: Workaround missing workspace
Not sure what causes it, not interested in figuring out right now.
This commit is contained in:
parent
3335f90de4
commit
460ab8938f
|
@ -19,7 +19,7 @@ from frobar.common import (AlertingProvider, Button, MirrorProvider, Module,
|
|||
MultiSectionsProvider, PeriodicProvider,
|
||||
PeriodicStatefulProvider, Screen, Section,
|
||||
SingleSectionProvider, StatefulSection,
|
||||
StatefulSectionProvider, clip, humanSize, ramp)
|
||||
StatefulSectionProvider, clip, humanSize, log, ramp)
|
||||
|
||||
gi.require_version("Playerctl", "2.0")
|
||||
import gi.repository.Playerctl
|
||||
|
@ -81,7 +81,12 @@ class I3WorkspacesProvider(MultiSectionsProvider):
|
|||
section.setAction(Button.CLICK_LEFT, switch_to_workspace)
|
||||
|
||||
async def update() -> None:
|
||||
workspace = self.workspaces[num]
|
||||
workspace = self.workspaces.get(num)
|
||||
if workspace is None:
|
||||
log.warning(f"Can't find workspace {num}")
|
||||
section.setText("X")
|
||||
return
|
||||
|
||||
name = workspace.name
|
||||
if workspace.urgent:
|
||||
section.color = self.COLOR_URGENT
|
||||
|
|
Loading…
Reference in a new issue