summaryrefslogtreecommitdiff
path: root/bar/Mpris.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-17 13:04:40 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-18 00:44:22 +0800
commit1078ef324f8e83a4390fcc5e565119dff9228c8c (patch)
tree668ac8859dbeb7ea8ce2a4330a38bcaf5c228304 /bar/Mpris.qml
parentf23ced82012a9f85739210aa333cd6f92815c50a (diff)
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
Diffstat (limited to 'bar/Mpris.qml')
-rw-r--r--bar/Mpris.qml16
1 files changed, 2 insertions, 14 deletions
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