Krolyxon
Commit 9c4cb2d

Branches

Refs →

aurora9c4cb2d

aurora: add notification sound on popup

Author
krolyxon
Date
2026-10-12 12:04 +0530
Parent
eec80fe
Commit
9c4cb2d973900fb3095720bd54717f909f5872e7

+13 −0

3 files changed

  1. M .config/hypr/hyprland.lua +1 −0
  2. M .config/quickshell/aurora/Notifs.qml +12 −0
  3. A .config/quickshell/aurora/sounds/Blow.aiff
M .config/hypr/hyprland.lua View
@@ -20,6 +20,7 @@ hl.on("hyprland.start", function()
2020 hl.exec_cmd("wl-paste --type image --watch cliphist store")
2121 hl.exec_cmd("hyprpm reload -n")
2222 hl.exec_cmd("kanshi")
23+ hl.exec_cmd("systemctl --user start aurora")
2324 -- hl.exec_cmd("waybar")
2425 -- hl.exec_cmd("swaync")
2526 hl.exec_cmd("gammastep")
M .config/quickshell/aurora/Notifs.qml View
@@ -8,6 +8,11 @@ import Quickshell.Services.Notifications
88 Singleton {
99 id: root
1010 property bool dnd: false
11+
12+ // sound played on every toast (silenced by do-not-disturb, except critical ones)
13+ property bool soundEnabled: true
14+ property string soundFile: Quickshell.env("HOME") + "/.config/quickshell/aurora/sounds/Blow.aiff"
15+ property real soundVolume: 0.7
1116 property var popups: [] // [{n, until}]
1217 readonly property var model: server.trackedNotifications
1318 readonly property int count: server.trackedNotifications.values.length
@@ -26,7 +31,14 @@ Singleton {
2631 function dropPopup(n) {
2732 popups = popups.filter(function (p) { return p.n !== n })
2833 }
34+ function playSound() {
35+ if (!soundEnabled) return
36+ Quickshell.execDetached(["sh", "-c",
37+ '[ -f "$1" ] || exit 0; pw-play --volume="$2" "$1" 2>/dev/null || paplay "$1" 2>/dev/null',
38+ "sh", soundFile, String(soundVolume)])
39+ }
2940 function push(n) {
41+ playSound()
3042 var ms = n.urgency === NotificationUrgency.Critical ? 12000
3143 : (n.expireTimeout > 0 ? n.expireTimeout * 1000 : 5000)
3244 var next = popups.concat([{ n: n, until: Date.now() + ms }])
A .config/quickshell/aurora/sounds/Blow.aiff View

[Binary file]