Use better notification lib

This commit is contained in:
2026-01-11 09:12:13 +00:00
parent b926173f43
commit 4d0e29550c
3 changed files with 40 additions and 20 deletions

11
main.go
View File

@@ -31,6 +31,7 @@ import (
"github.com/makeworld-the-better-one/go-isemoji"
"github.com/rrivera/identicon"
"github.com/shreve/musicwand/pkg/mpris"
"github.com/gen2brain/beeep"
// xmpp - required
oasisSdk "github.com/sunglocto/oasis-sdk"
@@ -445,7 +446,9 @@ func dropToSignInPage(reason string) {
dialog.ShowError(err, w)
return
}
a.SendNotification(fyne.NewNotification("Done", "Relaunch the application"))
// a.SendNotification(fyne.NewNotification("Done", "Relaunch the application"))
beeep.Notify("Done", "Relaunch the application", iconBytes)
a.Quit()
//w.Close()
}
@@ -504,7 +507,8 @@ func main() {
if ok {
str := *msg.CleanedBody
if notifications {
a.SendNotification(fyne.NewNotification(fmt.Sprintf("%s says", userJidStr), str))
// a.SendNotification(fyne.NewNotification(fmt.Sprintf("%s says", userJidStr), str))
beeep.Notify("Direct message", fmt.Sprintf("%s says:\n%s", userJidStr, str), iconBytes)
}
for _, v := range msg.Unknown {
@@ -610,7 +614,8 @@ func main() {
}
if !donotnotify && !ignore && notifications {
if !correction && msg.From.String() != client.JID.String() && strings.Contains(str, login.DisplayName) || (msg.Reply != nil && strings.Contains(msg.Reply.To, login.DisplayName)) {
a.SendNotification(fyne.NewNotification(fmt.Sprintf("Mentioned in %s", mucJidStr), str))
// a.SendNotification(fyne.NewNotification(fmt.Sprintf("Mentioned in %s", mucJidStr), str))
beeep.Notify(fmt.Sprintf("Mentioned in %s by %s", mucJidStr, msg.From.Resourcepart()), str, iconBytes)
}
}
if strings.Contains(str, "https://") {