From 5f87d3a99f86831e993ceb57e0f3c4efb4736709 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 6 May 2025 23:50:17 +0200 Subject: [PATCH] notif: escape when copying --- .../quickshell/modules/common/widgets/NotificationWidget.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/modules/common/widgets/NotificationWidget.qml b/.config/quickshell/modules/common/widgets/NotificationWidget.qml index 772aca0ae..d66ea6b3f 100644 --- a/.config/quickshell/modules/common/widgets/NotificationWidget.qml +++ b/.config/quickshell/modules/common/widgets/NotificationWidget.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/services" +import "root:/modules/common/functions/string_utils.js" as StringUtils import Qt5Compat.GraphicalEffects import QtQuick import QtQuick.Controls @@ -121,7 +122,7 @@ Item { } onPressAndHold: (mouse) => { if (mouse.button === Qt.LeftButton) { - Hyprland.dispatch(`exec wl-copy '${notificationObject.body}'`) + Hyprland.dispatch(`exec wl-copy '${StringUtils.shellSingleQuoteEscape(notificationObject.body)}'`) notificationSummaryText.text = `${notificationObject.summary} (copied)` } } @@ -537,7 +538,7 @@ Item { (contentItem.implicitWidth + leftPadding + rightPadding) onClicked: { - Hyprland.dispatch(`exec wl-copy '${notificationObject.body}'`) + Hyprland.dispatch(`exec wl-copy '${StringUtils.shellSingleQuoteEscape(notificationObject.body)}'`) copyIcon.text = "inventory" copyIconTimer.stop() copyIconTimer.start()