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:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user