Documentation
¶
Overview ¶
Package desktopnotify posts native desktop notifications from the daemon. On Linux it calls org.freedesktop.Notifications on the session bus using the godbus dependency lerd already ships; other platforms are no-ops for now.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppInstalled ¶
func AppInstalled() bool
AppInstalled reports whether the Lerd desktop app is registered as the lerd:// scheme handler, so callers can prefer it over a browser.
func IconPath ¶
func IconPath() string
IconPath materializes the bundled lerd icon to a stable cache path and returns its absolute path. Notification daemons that ignore themed names still show the logo this way. Returns "" on failure, letting the daemon draw its default.
func OpenApp ¶
OpenApp focuses (or launches) the desktop app at the given dashboard route via its lerd:// scheme.
func Supported ¶
func Supported() bool
Supported reports whether native notifications can be delivered on this host. True when a daemon already owns the well-known name (GNOME, KDE, which run it as part of the session) or when the name is D-Bus activatable (mako, dunst, xfce4-notifyd, which auto-start on the first Notify). False on a headless host with no session bus and no daemon, so callers fall back to the browser sink.
Types ¶
type Request ¶
type Request struct {
AppName string
Icon string // themed icon name or absolute path; "" shows the daemon default
Summary string
Body string
Urgency Urgency
Route string // dashboard route to open on click; "" makes the popup inert
}
Request is a single native notification to show.
type Urgency ¶
type Urgency byte
Urgency maps to the org.freedesktop.Notifications "urgency" hint byte.
func UrgencyFromString ¶
UrgencyFromString maps lerd's notification urgency strings to the DBus hint. Unknown or empty values are Normal, matching the Web Push default.