From 4e5ee4f9ba0780aade2d361d7d67e201853e47ac Mon Sep 17 00:00:00 2001 From: The_miro Date: Sun, 5 Jul 2026 20:11:36 +0200 Subject: [PATCH] fix(astal-menu): single module border; unblock rfkill so Bluetooth powers on - Borders: with the app stylesheet now above the theme, the CSS `.quad-card` border rendered a second ring concentric with the Cairo bordered() ring. Drop the CSS border/background/radius from the card boxes so only the Cairo card shows. - Bluetooth: the power/scan/connect controls were correctly wired to AstalBluetooth, but the adapter was rfkill soft-blocked, making set_powered a silent no-op. The power toggle now runs `rfkill unblock bluetooth` before powering on. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01XUWCXM4KhjRkwheaA3X7bP --- desktopenvs/hyprlua/astal-menu/modules/bluetooth.py | 12 ++++++++++-- desktopenvs/hyprlua/astal-menu/style/style.css | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/desktopenvs/hyprlua/astal-menu/modules/bluetooth.py b/desktopenvs/hyprlua/astal-menu/modules/bluetooth.py index 3736c9c..b7d8f3b 100644 --- a/desktopenvs/hyprlua/astal-menu/modules/bluetooth.py +++ b/desktopenvs/hyprlua/astal-menu/modules/bluetooth.py @@ -15,6 +15,7 @@ import gi gi.require_version("Gtk", "4.0") from gi.repository import Gtk # noqa: E402 +from lib.proc import run_text from module_base import Feature, ModuleContext, ModuleInstance, ModuleSpec from paths import CACHE_DIR @@ -83,8 +84,15 @@ class _BluetoothView(Gtk.Box): def _on_power(self, _sw, value: bool) -> bool: ad = self._adapter() - if ad: - ad.set_powered(value) + if value: + # The adapter is frequently rfkill soft-blocked at boot; while blocked, + # AstalBluetooth.set_powered(True) is a silent no-op. Unblock first, then + # power on (bluez usually auto-powers on unblock, so set_powered is a + # belt-and-suspenders follow-up). + run_text(["rfkill", "unblock", "bluetooth"], + lambda *_a: ad.set_powered(True) if ad else None) + elif ad: + ad.set_powered(False) return False def _on_scan(self, btn: Gtk.ToggleButton) -> None: diff --git a/desktopenvs/hyprlua/astal-menu/style/style.css b/desktopenvs/hyprlua/astal-menu/style/style.css index 74ef87e..0d17849 100644 --- a/desktopenvs/hyprlua/astal-menu/style/style.css +++ b/desktopenvs/hyprlua/astal-menu/style/style.css @@ -45,16 +45,16 @@ drawingarea { .quad-card { min-height: 190px; } .section-title { color: @text; font-weight: bold; opacity: 0.85; } +/* The single module border + background is drawn with Cairo by bordered(fill_bg=True) + * (see lib/border.py); the CSS border/background here would render a second, + * concentric ring now that the app stylesheet sits above the theme, so only keep + * the inner content padding. */ .quad-card, .quad-expanded, .appdrawer, .taskbar, .favorites { - background: @bg; - border: 3px solid @accent; - border-radius: 18px; padding: 12px 14px; - margin: 3px; /* keep the border off the grid/overlay clip edge */ } .quad-header,