♻️ refactor(bar): Rename Language widget to HyprlandLanguage for clarity
This commit is contained in:
3 files changed
+5
-2
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
+2
-2
@@ -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.hyprland.service import HyprlandEvent
|
||||||
from fabric.system_tray.widgets import SystemTray
|
from fabric.system_tray.widgets import SystemTray
|
||||||
from fabric.widgets.shapes import Corner
|
from fabric.widgets.shapes import Corner
|
||||||
@@ -262,7 +262,7 @@ class Bar(Window):
|
|||||||
self.launcher.open("calendar")
|
self.launcher.open("calendar")
|
||||||
|
|
||||||
def on_language_switch(self, _=None, event: HyprlandEvent = None):
|
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)
|
self.language.set_tooltip_text(lang)
|
||||||
if not data.VERTICAL:
|
if not data.VERTICAL:
|
||||||
self.lang_label.set_label(lang[:2].lower())
|
self.lang_label.set_label(lang[:2].lower())
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ else:
|
|||||||
name="workspace-name",
|
name="workspace-name",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def on_workspace(obj, signal):
|
def on_workspace(obj, signal):
|
||||||
global activeWorkspace
|
global activeWorkspace
|
||||||
activeWorkspace = json.loads(signal.data[0])
|
activeWorkspace = json.loads(signal.data[0])
|
||||||
@@ -27,4 +28,5 @@ def on_workspace(obj, signal):
|
|||||||
else:
|
else:
|
||||||
workspace.set_label(f"W\no\nr\nk\ns\np\na\nc\ne\n\n{activeWorkspace}")
|
workspace.set_label(f"W\no\nr\nk\ns\np\na\nc\ne\n\n{activeWorkspace}")
|
||||||
|
|
||||||
|
|
||||||
connection.connect("event::workspace", on_workspace)
|
connection.connect("event::workspace", on_workspace)
|
||||||
Reference in new issue
Block a user