Run sound command in goroutine so notification shows up at the same time

This commit is contained in:
Tulir Asokan 2021-09-19 20:52:20 -04:00
parent 531a58ce4a
commit 05790c156d

View File

@ -76,7 +76,9 @@ func Send(title, text string, critical, sound bool) error {
if critical && len(soundCritical) > 0 { if critical && len(soundCritical) > 0 {
audioFile = soundCritical audioFile = soundCritical
} }
_ = exec.Command(audioCommand, audioFile).Run() go func() {
_ = exec.Command(audioCommand, audioFile).Run()
}()
} }
return exec.Command(notifySendPath, args...).Run() return exec.Command(notifySendPath, args...).Run()
} }