notification

Desktop notifications

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.2.0
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-09-01 07:17

Authors

  • SolitudeSF

Installation

nimble install notification
choosenim install notification
git clone https://github.com/SolitudeSF/notification

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
notification - - - - - - -

Dependencies

Package Version Optional
nim >= 1.0.0", "dbus", "imageman >= 0.8.1 No

Source

Repository https://github.com/SolitudeSF/notification
Homepage https://github.com/SolitudeSF/notification
Registry Source nimble_official

README

notification

Easily send desktop notifications.

Supported OS

  • [x] Linux/BSD (requires libdbus)

Installation

nimble install notification

Example

import notification

var n = initNotification(
  summary = "hello",
  body = "world",
  icon = "help-faq")

n.add Hint(kind: hkUrgency, urgency: Critical)

let handle = n.notify

Extended example using custom hint type

# Example of sending a custom Hint type that replaces an 
# existing notification as outlined here: 
# https://wiki.archlinux.org/index.php/Desktop_notifications#Replace_previous_notification 
#
# Note that unlike replaceId, which works only when replacing a notification within a 
# running application, this approach works across different processes, as it uses 
# libnotify's in-built mechanism for this.  

import notification
import dbus
import os

let hint = Hint(
    kind: hkCustom, 
    customName:"x-canonical-private-synchronous", 
    customValue: "some-identifier".asDbusValue)

var n = initNotification(
  appname = "someapp",
  summary = "hello",
  body = "I'm gonna be here a real long time...",
  icon = "help-faq", 
  timeout = initTimeout(30 * 1000), 
)
n.add(hint)

discard n.notify

n = initNotification(
  appname = "someapp",
  summary = "hello again",
  body = "Think again!",
  icon = "help-faq", 
  timeout = initTimeout(5 * 1000), 
)

n.add(hint)

sleep(2000)
discard n.notify