lol
This commit is contained in:
1 parent
13dae4fba7
commit
1930483ec2
76 files changed
+1411
-871
No files matched your search
@@ -0,0 +1,28 @@
|
||||
from fabric.bluetooth import BluetoothClient
|
||||
from fabric.widgets.box import Box
|
||||
from fabric.widgets.label import Label
|
||||
|
||||
|
||||
class Bluetooth(Box):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.bluetooth_client = BluetoothClient()
|
||||
self.bluetooth_icon = Label(
|
||||
label="",
|
||||
# name="symbol",
|
||||
style="font-size: 18px;",
|
||||
)
|
||||
|
||||
self.bluetooth_client.connect("changed", self.update_bluetooth_status)
|
||||
self.update_bluetooth_status()
|
||||
self.add(self.bluetooth_icon)
|
||||
|
||||
def update_bluetooth_status(self, *args):
|
||||
if self.bluetooth_client.enabled:
|
||||
self.bluetooth_icon.set_label("")
|
||||
else:
|
||||
self.bluetooth_icon.set_label("")
|
||||
|
||||
def on_destroy(self):
|
||||
self.bluetooth_client.disconnect("changed", self.update_bluetooth_status)
|
||||
Reference in new issue
Block a user