changed name to modus

This commit is contained in:
sankalp committed 2025-02-02 16:41:29 +05:45
1 parent c610f2251f
commit 0c7d17dda0
60 files changed
+848 -44

No files matched your search

@@ -0,0 +1,34 @@
from fabric.bluetooth import BluetoothClient
from fabric.widgets.box import Box
from snippets import MaterialIcon
class BluetoothIndicator(Box):
ICON_ENABLED = "bluetooth"
ICON_DISABLED = "bluetooth_disabled"
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.bluetooth_client = BluetoothClient()
self.bluetooth_icon = None
self.bluetooth_client.connect("changed", self.update_bluetooth_status)
self.update_bluetooth_status()
def update_bluetooth_status(self, *_):
icon_label = (
self.ICON_ENABLED if self.bluetooth_client.enabled else self.ICON_DISABLED
)
new_icon = MaterialIcon(icon_label, size=16)
if self.bluetooth_icon:
self.remove(self.bluetooth_icon)
self.bluetooth_icon = new_icon
self.add(self.bluetooth_icon)
def on_destroy(self):
self.bluetooth_client.disconnect("changed", self.update_bluetooth_status)