From c626734a000a6c1de6d04c5b969e7c533f6f686b Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Tue, 29 Jul 2025 12:39:38 +0545 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(bar):=20Rename=20?= =?UTF-8?q?Language=20widget=20to=20HyprlandLanguage=20for=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/assets/accounts.json | 1 + modules/bar/bar.py | 4 ++-- modules/bar/components/workspace.py | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 config/assets/accounts.json diff --git a/config/assets/accounts.json b/config/assets/accounts.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/config/assets/accounts.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/modules/bar/bar.py b/modules/bar/bar.py index 61a2653..6a54a56 100644 --- a/modules/bar/bar.py +++ b/modules/bar/bar.py @@ -1,4 +1,4 @@ -from fabric.hyprland.widgets import Language, get_hyprland_connection +from fabric.hyprland.widgets import HyprlandLanguage, get_hyprland_connection from fabric.hyprland.service import HyprlandEvent from fabric.system_tray.widgets import SystemTray from fabric.widgets.shapes import Corner @@ -262,7 +262,7 @@ class Bar(Window): self.launcher.open("calendar") def on_language_switch(self, _=None, event: HyprlandEvent = None): - lang = event.data[1] if event else Language().get_label() + lang = event.data[1] if event else HyprlandLanguage().get_label() self.language.set_tooltip_text(lang) if not data.VERTICAL: self.lang_label.set_label(lang[:2].lower()) diff --git a/modules/bar/components/workspace.py b/modules/bar/components/workspace.py index 072364b..e24a3d1 100644 --- a/modules/bar/components/workspace.py +++ b/modules/bar/components/workspace.py @@ -19,6 +19,7 @@ else: name="workspace-name", ) + def on_workspace(obj, signal): global activeWorkspace activeWorkspace = json.loads(signal.data[0]) @@ -27,4 +28,5 @@ def on_workspace(obj, signal): else: workspace.set_label(f"W\no\nr\nk\ns\np\na\nc\ne\n\n{activeWorkspace}") + connection.connect("event::workspace", on_workspace)