fixes and youtube button

This commit is contained in:
vaguesyntax
2025-10-26 14:12:04 +03:00
parent 496225ab9d
commit a05b041d69
3 changed files with 8 additions and 4 deletions
@@ -23,7 +23,7 @@ function findSuitableMaterialSymbol(summary = "") {
'ai response': 'neurology',
'control': 'settings',
'upsca': 'compare',
'music': 'music_note',
'music': 'queue_music',
'install': 'deployed_code_update',
'startswith:file': 'folder_copy', // Declarative startsWith check
@@ -29,7 +29,7 @@ AndroidQuickToggleButton {
}
musicReconizedProc.running = true
} catch(e) {
Quickshell.execDetached(["notify-send", "Unable to recognize music", "Please make sure your music is playing and try again", "-a", "Shell"])
Quickshell.execDetached(["notify-send", Translation.tr("Unable to recognize music"), Translation.tr("Please make sure your music is playing and try again"), "-a", "Shell"])
} finally {
root.toggled = false
}
@@ -64,12 +64,16 @@ AndroidQuickToggleButton {
Translation.tr("Music Recognized"),
root.recognizedTrack.title + " - " + root.recognizedTrack.subtitle,
"-A", "Shazam",
"-A", "YouTube",
"-a", "Shell"
]
stdout: StdioCollector {
onStreamFinished: {
if (this.text !== ""){
if (this.text === "") return
if (this.text == 0){
Qt.openUrlExternally(root.recognizedTrack.url);
} else {
Qt.openUrlExternally("https://www.youtube.com/results?search_query=" + root.recognizedTrack.title + " - " + root.recognizedTrack.subtitle);
}
}
}
@@ -1,6 +1,6 @@
#!/bin/bash
## can be added manually if not chosen automatically with running this on terminal 'pw-cli list-objects | grep node.name'
## can be added manually if not chosen automatically with running this on terminal 'pw-cli list-objects | grep node.name' and manually choose the one you want.
MONITOR_SOURCE=$(pactl list short sources 2>/dev/null | grep -m1 monitor | awk '{print $2}' || true)
INTERVAL=5