This commit is contained in:
Tulir Asokan
2018-04-19 11:10:34 +03:00
parent b17ff318c2
commit b1dc965a4a
14 changed files with 29 additions and 31 deletions

View File

@ -102,13 +102,13 @@ func (ai *ANSImage) SetAt(y, x int, r, g, b, brightness uint8) error {
func (ai *ANSImage) GetAt(y, x int) (*ANSIpixel, error) {
if y >= 0 && y < ai.h && x >= 0 && x < ai.w {
return &ANSIpixel{
R: ai.pixmap[y][x].R,
G: ai.pixmap[y][x].G,
B: ai.pixmap[y][x].B,
Brightness: ai.pixmap[y][x].Brightness,
upper: ai.pixmap[y][x].upper,
source: ai.pixmap[y][x].source,
},
R: ai.pixmap[y][x].R,
G: ai.pixmap[y][x].G,
B: ai.pixmap[y][x].B,
Brightness: ai.pixmap[y][x].Brightness,
upper: ai.pixmap[y][x].upper,
source: ai.pixmap[y][x].source,
},
nil
}
return nil, ErrOutOfBounds
@ -170,7 +170,7 @@ func New(h, w int, bg color.Color) (*ANSImage, error) {
r, g, b, _ := bg.RGBA()
ansimage := &ANSImage{
h: h, w: w,
h: h, w: w,
maxprocs: 1,
bgR: uint8(r),
bgG: uint8(g),

View File

@ -9,4 +9,3 @@
//
// This package is licensed under the Mozilla Public License v2.0.
package ansimage

View File

@ -42,9 +42,9 @@ func Send(title, text string, critical, sound bool) error {
if sound {
args = append(args, "-sound", "default")
}
// 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)

View File

@ -23,9 +23,9 @@ func Send(title, text string, critical, sound bool) error {
if critical {
args = append(args, "-u", "critical")
}
// if iconPath {
// args = append(args, "-i", iconPath)
// }
// if iconPath {
// args = append(args, "-i", iconPath)
// }
args = append(args, title, text)
if sound {
soundName := "message-new-instant"

View File

@ -25,7 +25,7 @@ func Send(title, text string, critical, sound bool) error {
Message: message,
Audio: toast.Silent,
Duration: toast.Short,
// Icon: ...,
// Icon: ...,
}
if sound {
notification.Audio = toast.IM