fix config reloading notifier and add callback to the daemon

This commit is contained in:
LeonardoTrapani
2025-08-20 20:06:59 +02:00
parent 99f82fb420
commit ddef3435f6
3 changed files with 77 additions and 14 deletions
+13
View File
@@ -1,6 +1,7 @@
package notify
import (
"github.com/leonardotrapani/hyprvoice/internal/config"
"log"
"os/exec"
)
@@ -48,3 +49,15 @@ type Nop struct{}
func (Nop) Error(msg string) {}
func (Nop) Notify(title, message string) {}
func GetNotifierBasedOnConfig(c *config.Config) Notifier {
switch c.Notifications.Type {
case "desktop":
return Desktop{}
case "log":
return Log{}
case "none":
return Nop{}
}
return Nop{}
}