aboutsummaryrefslogtreecommitdiff
path: root/notification/notify_linux.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-26 18:04:10 +0300
committerTulir Asokan <tulir@maunium.net>2018-03-26 18:04:10 +0300
commite0298521c6c12c5f347431bfad5b6a4d7ab8b465 (patch)
tree317a7e635eab0badefdf632d0a308980ead66d1b /notification/notify_linux.go
parentb31d96881432ebb1d4918ae970fabfd6362e1186 (diff)
Add sounds to notifications
Diffstat (limited to 'notification/notify_linux.go')
-rw-r--r--notification/notify_linux.go11
1 files changed, 9 insertions, 2 deletions
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()
}