mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
sounds: make qt6-multimedia optional
This commit is contained in:
@@ -3,7 +3,6 @@ pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.UPower
|
||||
@@ -23,22 +22,6 @@ Singleton {
|
||||
onTriggered: root.suppressSound = false
|
||||
}
|
||||
|
||||
MediaPlayer {
|
||||
id: powerPlugSound
|
||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-plug.ogg")
|
||||
audioOutput: AudioOutput {
|
||||
volume: 1.0
|
||||
}
|
||||
}
|
||||
|
||||
MediaPlayer {
|
||||
id: powerUnplugSound
|
||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-unplug.ogg")
|
||||
audioOutput: AudioOutput {
|
||||
volume: 1.0
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string preferredBatteryOverride: Quickshell.env("DMS_PREFERRED_BATTERY")
|
||||
|
||||
readonly property UPowerDevice device: {
|
||||
@@ -62,9 +45,9 @@ Singleton {
|
||||
|
||||
if (SettingsData.soundsEnabled && SettingsData.soundPluggedIn) {
|
||||
if (isPluggedIn && !previousPluggedState) {
|
||||
powerPlugSound.play()
|
||||
AudioService.playPowerPlugSound()
|
||||
} else if (!isPluggedIn && previousPluggedState) {
|
||||
powerUnplugSound.play()
|
||||
AudioService.playPowerUnplugSound()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user