added bluetooth widget

This commit is contained in:
sankalp committed 2025-01-11 21:28:51 +05:45
1 parent 336dc88fd2
commit d85bbdb94a
4 files changed
+31 -1

No files matched your search

+3 -1
View File
@@ -40,7 +40,9 @@ ttf-font-awesome, otf-font-awesome, ttf-material-symbols-variable-git, ttf-googl
# ToDo
- [ ] Add wifi, bluetooth, shrunner widget
- [x] Add bluetooth widget
- [ ] Add shrunner widget
- [ ] Add wifi widget
- [ ] Dashboard
- [ ] Notification panel
- [ ] Better css
@@ -6,6 +6,7 @@ from fabric.widgets.wayland import WaylandWindow as Window
from gi.repository import Gdk, GLib
from modules.launcher.widgets import (
AppLauncher,
BluetoothManager,
Cliphist,
Emoji,
PowerMenu,
@@ -29,11 +30,13 @@ class Launcher(Window):
self.emoji = Emoji()
self.cliphist = Cliphist()
self.todo = TodoManager()
self.bluetooth = BluetoothManager()
# Initialize viewports as None
self._emoji_viewport = None
self._cliphist_viewport = None
self._todo_viewport = None
self._bluetooth_viewport = None
self.stack = Stack(
name="launcher-content",
@@ -48,6 +51,7 @@ class Launcher(Window):
self.emoji,
self.cliphist,
self.todo,
self.bluetooth,
],
)
@@ -89,6 +93,8 @@ class Launcher(Window):
def close(self):
self.set_keyboard_mode("none")
self.hide()
if self.bluetooth.is_active:
self.bluetooth.stop_device_polling()
for widget in [
self.launcher,
@@ -97,6 +103,7 @@ class Launcher(Window):
self.emoji,
self.cliphist,
self.todo,
self.bluetooth,
]:
widget.remove_style_class("open")
@@ -120,6 +127,9 @@ class Launcher(Window):
if widget == self.todo and hasattr(widget, "viewport") and widget.viewport:
widget.viewport.hide()
if widget == self.bluetooth and widget.viewport:
widget.viewport.children = []
style_classes = [
"launcher",
"wallpapers",
@@ -127,6 +137,7 @@ class Launcher(Window):
"emoji",
"cliphist",
"todo",
"bluetooth",
]
for style_class in style_classes:
if self.stack.get_style_context().has_class(style_class):
@@ -145,6 +156,7 @@ class Launcher(Window):
"emoji": self.emoji,
"cliphist": self.cliphist,
"todo": self.todo,
"bluetooth": self.bluetooth,
}
style_classes = list(widgets.keys())
@@ -193,6 +205,11 @@ class Launcher(Window):
self.todo.todo_entry.set_text("")
self.todo.todo_entry.grab_focus()
elif widget == "bluetooth":
self.bluetooth.open_launcher()
self.bluetooth.search_entry.set_text("")
self.bluetooth.search_entry.grab_focus()
else:
if hasattr(self.wallpapers, "viewport"):
self.wallpapers.viewport.hide()
@@ -0,0 +1,10 @@
#device-slot {
background-color: @suraceVariant;
border-radius: 5px;
padding: 8px;
}
#device-slot:hover,
#device-slot:focus {
background-color: mix(@onSurface, @surface, 0.92);
}
+1
View File
@@ -9,6 +9,7 @@
@import "./launcher/todo.css";
@import "./launcher/emoji.css";
@import "./launcher/cliphist.css";
@import "./launcher/bluetooth.css";
* {
all: unset;