From e0298521c6c12c5f347431bfad5b6a4d7ab8b465 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 26 Mar 2018 18:04:10 +0300 Subject: Add sounds to notifications --- notification/notify_linux.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'notification/notify_linux.go') diff --git a/notification/notify_linux.go b/notification/notify_linux.go index 25ab405..f8ecdaf 100644 --- a/notification/notify_linux.go +++ b/notification/notify_linux.go @@ -18,14 +18,21 @@ package notification import "os/exec" -func Send(title, text string, critical bool) error { +func Send(title, text string, critical, sound bool) error { args := []string{"-a", "gomuks"} if critical { - args = append(args, "-p", "critical") + args = append(args, "-u", "critical") } // if iconPath { // args = append(args, "-i", iconPath) // } args = append(args, title, text) + if sound { + soundName := "message-new-instant" + if critical { + soundName = "complete" + } + exec.Command("paplay", "/usr/share/sounds/freedesktop/stereo/"+soundName+".oga").Run() + } return exec.Command("notify-send", args...).Run() } -- cgit v1.2.3