diff --git a/src/utils/functions.py b/src/utils/functions.py index a487e7a..4288ca2 100644 --- a/src/utils/functions.py +++ b/src/utils/functions.py @@ -198,7 +198,14 @@ def read_json_file(file_path: str) -> dict | None: def trigger_paste_shortcut(delay_ms: int = 50) -> bool: time.sleep(delay_ms / 1000) - result = run_command(["wtype", "-M", "ctrl", "v", "-m", "ctrl"], timeout=1) + result = run_command( + [ + "hyprctl", + "dispatch", + 'hl.dsp.send_shortcut({ mods = "CTRL", key = "V" })', + ], + timeout=1, + ) return result.returncode == 0 diff --git a/src/window/notification/notification.py b/src/window/notification/notification.py index acad904..f4423c8 100644 --- a/src/window/notification/notification.py +++ b/src/window/notification/notification.py @@ -22,7 +22,7 @@ from shared.widgets.clipping_box import ClippingBox from shared.widgets.close_button_revealer import CloseButtonRevealerMixin from shared.widgets.custom_image import CustomImage from shared.widgets.customrevealer import SlideRevealer -from utils.gtk_utils import setup_cursor_hover, svg_file +from utils.gtk_utils import setup_cursor_hover from utils.functions import escape_markup_text from utils.roam import modus_service from utils.icon_resolver import IconResolver @@ -531,44 +531,12 @@ class NotificationWidget(Box): self.show_all() def create_header(self, notification): - """Create notification header with app icon + app name + time""" - try: - cached_app_icon_pixbuf = cache_notification_icon( - notification.app_icon or notification.app_name, (64, 64) - ) - if cached_app_icon_pixbuf: - header_icon_pixbuf = cached_app_icon_pixbuf.scale_simple( - 16, 16, GdkPixbuf.InterpType.BILINEAR - ) - app_icon = ClippingBox( - name="notification-icon", - children=Image(pixbuf=header_icon_pixbuf), - ) - else: - app_icon = ClippingBox( - name="notification-icon", - children=svg_file("notifications/notification-active.svg", size=16), - ) - except Exception as e: - logger.warning(f"Failed to load cached header icon: {e}") - app_icon = ClippingBox( - name="notification-icon", - children=svg_file("notifications/notification-active.svg", size=16), - ) - - return Box( - name="notification-header", - orientation="h", - spacing=4, - children=[ - app_icon, - Label( - notification.app_name or "", - name="notification-app-name", - h_align="start", - ellipsization="end", - ), - ], + """Create notification header with app name + time""" + return Label( + notification.app_name or "", + name="notification-app-name", + h_align="start", + ellipsization="end", ) def create_content(self, notification): diff --git a/src/window/spotlight/app.py b/src/window/spotlight/app.py index bcf1b4d..fa522dd 100644 --- a/src/window/spotlight/app.py +++ b/src/window/spotlight/app.py @@ -128,7 +128,10 @@ def main(command: str = "", text: str = "", external: bool = False): def _close_and_quit(): _orig_close() - app.quit() + # Plugins schedule the paste via GLib.timeout_add (emoji/clipboard), + # which only fires while the main loop runs. Quit a tick later so a + # deferred paste is not killed before it can inject the shortcut. + GLib.timeout_add(100, app.quit) spotlight.close_spotlight = _close_and_quit