Categorygithub.com/gen2brain/beeep
modulepackage
0.0.0-20240516210008-9c006672e7f4
Repository: https://github.com/gen2brain/beeep.git
Documentation: pkg.go.dev

# README

beeep

Build Status Go Reference Go Report Card

beeep provides a cross-platform library for sending desktop notifications, alerts and beeps.

Installation

go get -u github.com/gen2brain/beeep

Build tags

  • nodbus - disable godbus/dbus and use only notify-send

Examples

err := beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
if err != nil {
    panic(err)
}
err := beeep.Notify("Title", "Message body", "assets/information.png")
if err != nil {
    panic(err)
}
err := beeep.Alert("Title", "Message body", "assets/warning.png")
if err != nil {
    panic(err)
}

# Functions

Alert displays a desktop notification and plays a beep.
Beep beeps the PC speaker (https://en.wikipedia.org/wiki/PC_speaker).
Notify sends desktop notification.

# Variables

DefaultDuration - duration in milliseconds.
DefaultFreq - frequency, in Hz, middle A.
ErrUnsupported is returned when operating system is not supported.