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
1 changed files with 7 additions and 2 deletions
|
@ -19,7 +19,7 @@ from frobar.common import (AlertingProvider, Button, MirrorProvider, Module,
|
||||||
MultiSectionsProvider, PeriodicProvider,
|
MultiSectionsProvider, PeriodicProvider,
|
||||||
PeriodicStatefulProvider, Screen, Section,
|
PeriodicStatefulProvider, Screen, Section,
|
||||||
SingleSectionProvider, StatefulSection,
|
SingleSectionProvider, StatefulSection,
|
||||||
StatefulSectionProvider, clip, humanSize, ramp)
|
StatefulSectionProvider, clip, humanSize, log, ramp)
|
||||||
|
|
||||||
gi.require_version("Playerctl", "2.0")
|
gi.require_version("Playerctl", "2.0")
|
||||||
import gi.repository.Playerctl
|
import gi.repository.Playerctl
|
||||||
|
@ -81,7 +81,12 @@ class I3WorkspacesProvider(MultiSectionsProvider):
|
||||||
section.setAction(Button.CLICK_LEFT, switch_to_workspace)
|
section.setAction(Button.CLICK_LEFT, switch_to_workspace)
|
||||||
|
|
||||||
async def update() -> None:
|
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
|
name = workspace.name
|
||||||
if workspace.urgent:
|
if workspace.urgent:
|
||||||
section.color = self.COLOR_URGENT
|
section.color = self.COLOR_URGENT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue