From dabb3254363a7ab871cc48779b40a931fa3c0619 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sat, 26 Apr 2025 21:14:05 +0200 Subject: [PATCH] [AGS] Fix Bluetooth menu --- .../modules/Bluetooth/Bluetooth.tsx | 66 +++++-------------- config/rofi/style.rasi | 2 +- config/wlogout/style.css | 2 +- 3 files changed, 20 insertions(+), 50 deletions(-) diff --git a/config/astal/components/QuickActions/modules/Bluetooth/Bluetooth.tsx b/config/astal/components/QuickActions/modules/Bluetooth/Bluetooth.tsx index 74cff75..35b35e6 100644 --- a/config/astal/components/QuickActions/modules/Bluetooth/Bluetooth.tsx +++ b/config/astal/components/QuickActions/modules/Bluetooth/Bluetooth.tsx @@ -3,48 +3,21 @@ import { Gtk } from "astal/gtk4"; import AstalBluetooth from "gi://AstalBluetooth"; import BTDevice from "./Device"; const ALIGN = Gtk.Align; -const MAX_RETRY = 20; const bt = AstalBluetooth.get_default(); -// const LaunchBluetoothModule = () => { -// const box = new Gtk.Box(); -// -// const placeholder = () => { -// return -// } -// -// if (bt.adapter) { -// box.append(BluetoothModule()); -// } else { -// const p = placeholder(); -// box.append(p); -// -// let count = 0; -// const i = interval(1000, () => { -// if (bt.adapter !== null) { -// box.remove(p); -// box.append(BluetoothModule()); -// i.cancel(); -// } else if (count >= MAX_RETRY) { -// i.cancel(); -// } -// count++; -// }); -// } -// -// return box; -// } - const BluetoothModule = () => { + const picker = BluetoothPicker(); + + const openBTPicker = () => { + try { + bt.adapter.start_discovery(); + } catch (e) { + printerr(e); + } + picker.popup(); + }; + return (