1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-10 07:25:37 -05:00

Incorporate some system sounds

This commit is contained in:
bbedward
2025-10-13 22:38:13 -04:00
parent 381df1e949
commit b5e29cf50c
13 changed files with 538 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import QtMultimedia
import Quickshell
import Quickshell.Services.Notifications
import Quickshell.Widgets
@@ -198,6 +199,22 @@ Singleton {
property var expandedMessages: ({})
property bool popupsDisabled: false
MediaPlayer {
id: normalNotificationSound
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message.oga")
audioOutput: AudioOutput {
volume: 1.0
}
}
MediaPlayer {
id: criticalNotificationSound
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message-new-instant.oga")
audioOutput: AudioOutput {
volume: 1.0
}
}
NotificationServer {
id: server
@@ -225,6 +242,14 @@ Singleton {
}
}
if (SettingsData.soundsEnabled && SettingsData.soundNewNotification) {
if (notif.urgency === NotificationUrgency.Critical) {
criticalNotificationSound.play()
} else {
normalNotificationSound.play()
}
}
const shouldShowPopup = !root.popupsDisabled && !SessionData.doNotDisturb
const isTransient = notif.transient
const wrapper = notifComponent.createObject(root, {