1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 15:32:50 -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,9 +3,11 @@ pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import QtMultimedia
import Quickshell
import Quickshell.Io
import Quickshell.Services.Pipewire
import qs.Common
Singleton {
id: root
@@ -25,6 +27,32 @@ Singleton {
onTriggered: root.suppressOSD = false
}
MediaPlayer {
id: volumeChangeSound
source: Qt.resolvedUrl("../assets/sounds/freedesktop/audio-volume-change.oga")
audioOutput: AudioOutput {
volume: 1.0
}
}
Timer {
id: volumeSoundDebounce
interval: 50
repeat: false
onTriggered: {
if (SettingsData.soundsEnabled && SettingsData.soundVolumeChanged && !root.suppressOSD) {
volumeChangeSound.play()
}
}
}
Connections {
target: root.sink?.audio
function onVolumeChanged() {
volumeSoundDebounce.restart()
}
}
function displayName(node) {
if (!node) {
return ""