19 lines
451 B
Go
19 lines
451 B
Go
package notify
|
|
|
|
import (
|
|
"errors"
|
|
"os/exec"
|
|
)
|
|
|
|
func Send(title, body string) error {
|
|
if _, err := exec.LookPath("notify-send"); err == nil {
|
|
return exec.Command("notify-send", "-a", "LazyUpdateManager", title, body).Run()
|
|
}
|
|
|
|
if _, err := exec.LookPath("hyprctl"); err == nil {
|
|
return exec.Command("hyprctl", "notify", "1", "8000", "rgb(73daca)", title+": "+body).Run()
|
|
}
|
|
|
|
return errors.New("neither notify-send nor hyprctl is available")
|
|
}
|