Skip to content

desktop: set the notification application name from --title - #233

Merged
nlewo merged 1 commit into
nlewo:mainfrom
RyoKusnadi:fix/desktop-notification-app-name
Nov 21, 2026
Merged

nlewo merged 1 commit into
nlewo:mainfrom
RyoKusnadi:fix/desktop-notification-app-name

Conversation

@RyoKusnadi

Copy link
Copy Markdown
Contributor

Fixes #229

Problem

comin desktop notifications show the app name "DefaultAppName" in the desktop environment instead of something meaningful.

How it happens: run comin desktop (or the comin-desktop user service from the NixOS module) and wait for any notification. The notification daemon shows the app name next to the title.

Expected: app name is the --title value (default "comin").
Actual: "DefaultAppName".

Cause

cmd/desktop.go never sets beeep.AppName. The beeep library (v0.11.2) defaults it to "DefaultAppName" and sends that as the app name over DBus.

Fix

New small helper setAppName that sets beeep.AppName. Run calls it with the --title value before the startup notification. handler() needs nothing extra because it runs after that, and beeep.AppName is a package global. Notification title and body are unchanged.

Scope

beeep.Notify is only called in cmd/desktop.go (startup and handler), so nothing else is affected. The --title flag and the Nix module option stay as they are. I did not touch the existing gofmt differences in that file.

Testing

New TestSetAppName in cmd/desktop_test.go: foo gives foo, the flag default gives comin.

Before the fix it didn't build, since setAppName didn't exist:

cmd/desktop_test.go:16:3: undefined: setAppName
FAIL	github.com/nlewo/comin/cmd [build failed]

After: ok github.com/nlewo/comin/cmd.

Ran: go vet ./cmd/, go test -race -count=1 ./cmd/. Not run: the full suite, the NixOS module, or a real notification daemon (the test checks the value, not what the desktop shows).

Environment: main @ c847682, go1.27.4, darwin/arm64

Risk

Low. Only the app name label changes.

Signed-off-by: Ryo Kusnadi <ryokusnadi@gmail.com>
@nlewo

nlewo commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thank you!

@nlewo
nlewo merged commit 4cc0f6a into nlewo:main Nov 21, 2026
2 checks passed
@RyoKusnadi
RyoKusnadi deleted the fix/desktop-notification-app-name branch November 28, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop notification "app name" is "DefaultAppName"

2 participants