MCPcopy Create free account
hub / github.com/debuggyo/Exo / __init__

Method __init__

ignis/modules/bar/widgets/workspaces.py:168–201  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

166
167class Workspaces(widgets.EventBox):
168 def __init__(self):
169 self._workspace_box = widgets.Box(
170 css_classes=["workspaces"],
171 halign="center",
172 hexpand=True,
173 valign="center",
174 vexpand=True,
175 )
176 user_settings.interface.modules.options.connect_option(
177 "workspaces_style", lambda: self.update_workspaces()
178 )
179 user_settings.interface.modules.options.connect_option(
180 "fixed_workspaces_enabled", lambda: self.update_workspaces()
181 )
182 user_settings.interface.modules.options.connect_option(
183 "fixed_workspaces_amount", lambda: self.update_workspaces()
184 )
185
186 super().__init__(
187 child=[self._workspace_box],
188 on_scroll_up=lambda self: self.workspaces_scroll(+1),
189 on_scroll_down=lambda self: self.workspaces_scroll(-1),
190 )
191
192 self._last_style = None
193 self._last_workspace_ids = []
194 self._last_fixed_enabled = False
195
196 if SERVICE:
197 SERVICE.connect("notify::workspaces", self.update_workspaces)
198 SERVICE.connect("notify::active-workspace", self.update_workspaces)
199 self.update_workspaces()
200
201 self.update_layout()
202
203 def update_workspaces(self, *args):
204 bar = (

Callers 1

__init__Method · 0.45

Calls 3

update_workspacesMethod · 0.95
workspaces_scrollMethod · 0.95
update_layoutMethod · 0.95

Tested by

no test coverage detected