notif: escape when copying

This commit is contained in:
end-4
2025-05-06 23:50:17 +02:00
parent 418ac5da0c
commit 5f87d3a99f
@@ -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()