From 1078ef324f8e83a4390fcc5e565119dff9228c8c Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 17 Aug 2025 13:04:40 +0800 Subject: Reapply "refactor(clip): use Quickshell.execDetached when avaliable" This reverts commit 7b4076be7e305bacf8c55d75589e841c29d250e1. fix(Clip): sh escaping args from user data chore: migrate mpris stringutils to actual stringutils StringUtils is copied from end4-dots, GPL Licensed This also fixes image not being copied properly --- bar/Mpris.qml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'bar') diff --git a/bar/Mpris.qml b/bar/Mpris.qml index 092e459..7d14ba4 100644 --- a/bar/Mpris.qml +++ b/bar/Mpris.qml @@ -10,24 +10,12 @@ import qs.services as Services import qs.config import qs.components +import "../utils/string_utils.js" as StringUtils Item { id: root readonly property MprisPlayer activePlayer: Services.Mpris.activePlayer - readonly property string cleanedTitle: cleanMusicTitle(activePlayer?.trackTitle) - - function cleanMusicTitle(title) { - if (!title) - return ""; - title = title.replace(/\s*\([^)]*\)/g, " "); - title = title.replace(/\s*\[[^\]]*\]/g, " "); - title = title.replace(/\s*\{[^\}]*\}/g, " "); - title = title.replace(/\s*【[^】]*】/g, " "); - title = title.replace(/\s*《[^》]*》/g, " "); - title = title.replace(/\s*「[^」]*」/g, " "); - title = title.replace(/\s*『[^』]*』/g, " "); - return title.trim(); - } + readonly property string cleanedTitle: StringUtils.cleanMusicTitle(activePlayer?.trackTitle) implicitWidth: activePlayer ? rect.width - General.rectMargin / 1.2 : 0 height: Bar.height + General.rectMargin / 1.5 -- cgit v1.2.3