✨ feat(panel): add workspace indicator to panel
This commit is contained in:
1 parent
3f9c9139a6
commit
610865ef2d
5 files changed
+75
-19
No files matched your search
@@ -0,0 +1,25 @@
|
||||
from fabric.hyprland.widgets import HyprlandWorkspaces, WorkspaceButton
|
||||
from fabric.widgets.box import Box
|
||||
|
||||
# TODO: Support Multi Monitor
|
||||
|
||||
class WorkspaceIndicator(Box):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(
|
||||
name="workspace-indicator",
|
||||
orientation="h",
|
||||
spacing=4,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
self.workspaces = HyprlandWorkspaces(
|
||||
name="workspaces",
|
||||
spacing=4,
|
||||
buttons_factory=lambda ws_id: WorkspaceButton(
|
||||
id=ws_id,
|
||||
label=str(ws_id)
|
||||
),
|
||||
)
|
||||
|
||||
self.add(self.workspaces)
|
||||
self.show_all()
|
||||
@@ -16,6 +16,7 @@ from modules.panel.components.indicators import (
|
||||
)
|
||||
from modules.panel.components.menubar import MenuBar
|
||||
from modules.panel.components.recording_indicator import RecordingIndicator
|
||||
from modules.panel.components.workspace import WorkspaceIndicator
|
||||
from utils.roam import modus_service
|
||||
from widgets.mousecapture import MouseCapture
|
||||
from widgets.wayland import WaylandWindow as Window
|
||||
@@ -133,6 +134,9 @@ class Panel(Window):
|
||||
|
||||
self.recording_indicator = RecordingIndicator()
|
||||
|
||||
# Workspace indicator
|
||||
self.workspace_indicator = WorkspaceIndicator()
|
||||
|
||||
self.children = CenterBox(
|
||||
name="panel",
|
||||
start_children=Box(
|
||||
@@ -151,6 +155,7 @@ class Panel(Window):
|
||||
spacing=4,
|
||||
orientation="h",
|
||||
children=[
|
||||
self.workspace_indicator,
|
||||
self.dnd_indicator,
|
||||
self.tray_revealer,
|
||||
self.chevron_button,
|
||||
|
||||
Reference in new issue
Block a user