feat(notify): Windows toasts under talk's own identity, icon on Linux
The daemon (and talk test --toast) now register the AppUserModelID m3ta.talk under HKCU with display name and the installed icon, so toasts appear as "talk" with the icon instead of Windows PowerShell; the PowerShell identity stays as fallback until the registration has run once. The redundant "talk" title line is dropped under the own identity. notify.Setup bundles icon install, identity and the talk: protocol handler for both callers. Linux notifications carry the installed icon as app_icon. doctor names the active identity. Verified on the Windows 11 VM: registry key, icon file, toast with working Cancel button, exe icon; Linux via quickshell. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e77cf0a11
commit
2d9d2a86e9
10 files changed
+290
-48
No files matched your search
@@ -15,7 +15,6 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -85,13 +84,12 @@ func Run(ctx context.Context, opts Options) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Windows: the toast's Cancel button opens a talk: link; register the
|
||||
// protocol handler for this user so the click starts `talk uri`.
|
||||
if cfg.Notify.OnSpeak && runtime.GOOS == "windows" {
|
||||
if exe, err := os.Executable(); err == nil {
|
||||
if err := notify.RegisterProtocol(exe); err != nil {
|
||||
logger.Printf("warning: %v; the toast's Cancel button will not work", err)
|
||||
}
|
||||
// Desktop side: the icon next to the config, Windows additionally the
|
||||
// toast identity and the talk: protocol handler for the Cancel button.
|
||||
if dir, err := config.Dir(getenv); err == nil {
|
||||
exe, _ := os.Executable()
|
||||
if err := notify.Setup(dir, exe); err != nil {
|
||||
logger.Printf("warning: %v; notifications fall back to the plain identity or lose the Cancel button", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user