aboutsummaryrefslogtreecommitdiff
path: root/notification
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-21 00:21:16 +0200
committerTulir Asokan <tulir@maunium.net>2018-03-21 00:21:24 +0200
commit7994c289aae7662fee9b86f9424d230c7b612b3d (patch)
treea9a3e1ae636c44455c08fbe6f89f00756123ef3c /notification
parent3ad2c11865a9b4b4d5128553eb3bbcb0c1969133 (diff)
Refactor some things and format everything
Diffstat (limited to 'notification')
-rw-r--r--notification/notify_darwin.go9
-rw-r--r--notification/notify_linux.go6
-rw-r--r--notification/notify_windows.go10
3 files changed, 12 insertions, 13 deletions
diff --git a/notification/notify_darwin.go b/notification/notify_darwin.go
index 3a4a8c2..f7a2d89 100644
--- a/notification/notify_darwin.go
+++ b/notification/notify_darwin.go
@@ -17,8 +17,8 @@
package notification
import (
- "os/exec"
"fmt"
+ "os/exec"
"strings"
)
@@ -37,9 +37,9 @@ func Send(title, text string, critical bool) error {
if critical {
args = append(args, "-timeout", "30")
}
-// if len(iconPath) > 0 {
-// args = append(args, "-appIcon", iconPath)
-// }
+// if len(iconPath) > 0 {
+// args = append(args, "-appIcon", iconPath)
+// }
return exec.Command("terminal-notifier", args...).Run()
}
title = strings.Replace(title, `"`, `\"`, -1)
@@ -47,4 +47,3 @@ func Send(title, text string, critical bool) error {
notification := fmt.Sprintf("display notification \"%s\" with title \"gomuks\" subtitle \"%s\"", text, title)
return exec.Command("osascript", "-e", notification).Run()
}
-
diff --git a/notification/notify_linux.go b/notification/notify_linux.go
index f48e208..25ab405 100644
--- a/notification/notify_linux.go
+++ b/notification/notify_linux.go
@@ -23,9 +23,9 @@ func Send(title, text string, critical bool) error {
if critical {
args = append(args, "-p", "critical")
}
-// if iconPath {
-// args = append(args, "-i", iconPath)
-// }
+// if iconPath {
+// args = append(args, "-i", iconPath)
+// }
args = append(args, title, text)
return exec.Command("notify-send", args...).Run()
}
diff --git a/notification/notify_windows.go b/notification/notify_windows.go
index 74ef7a6..71c547d 100644
--- a/notification/notify_windows.go
+++ b/notification/notify_windows.go
@@ -20,12 +20,12 @@ import "gopkg.in/toast.v1"
func Send(title, text string, critical bool) error {
notification := toast.Notification{
- AppID: "gomuks",
- Title: title,
- Message: message,
- Audio: toast.IM,
+ AppID: "gomuks",
+ Title: title,
+ Message: message,
+ Audio: toast.IM,
Duration: toast.Short,
-// Icon: ...,
+// Icon: ...,
}
if critical {
notification.Duration = toast.Long