Refactor some things and format everything
This commit is contained in:
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user