add pid file, add context for go routines + add proper logging

This commit is contained in:
LeonardoTrapani
2025-08-07 18:52:45 +02:00
parent f7936610c9
commit 1acd007be0
7 changed files with 212 additions and 86 deletions
+10 -3
View File
@@ -2,6 +2,7 @@ package notify
import (
"fmt"
"log"
"os/exec"
)
@@ -17,12 +18,18 @@ func (Desktop) RecordingChanged(on bool) {
if on {
state = "Started"
}
exec.Command("notify-send", "-a", "Hyprvoice",
fmt.Sprintf("Hyprvoice: %s Recording", state)).Run()
cmd := exec.Command("notify-send", "-a", "Hyprvoice",
fmt.Sprintf("Hyprvoice: %s Recording", state))
if err := cmd.Run(); err != nil {
log.Printf("Failed to send notification: %v", err)
}
}
func (Desktop) Error(msg string) {
exec.Command("notify-send", "-a", "Hyprvoice", "-u", "critical", msg).Run()
cmd := exec.Command("notify-send", "-a", "Hyprvoice", "-u", "critical", msg)
if err := cmd.Run(); err != nil {
log.Printf("Failed to send error notification: %v", err)
}
}
// Nop is a Notifier that does absolutely nothing.