Module naughty
Notification library
Author:
koniu <gkusnierz@gmail.com> |
Copyright© 2008 koniu
Release: v3.3.4
Functions
destroy (notification) | Destroy notification by index |
notify (args, text, timeout, title, position, icon, icon_size, fg, bg, screen, ontop, run, width, replaces_id) | Create notification. |
Tables
config | Naughty configuration - a table containing common/default popup settings. |
config.presets | Notification Presets - a table containing presets for different purposes You have to pass a reference of a preset in your notify() call to use the preset At least the default preset named "normal" has to be defined The presets "low", "normal" and "critical" are used for notifications over DBUS |
notifications[position] | Index of notifications. |
Functions
- destroy (notification)
-
Destroy notification by index
Parameters
- notification: Notification object to be destroyed
Return value:
True if the popup was successfully destroyed, nil otherwise - notify (args, text, timeout, title, position, icon, icon_size, fg, bg, screen, ontop, run, width, replaces_id)
-
Create notification. args is a dictionary of optional arguments. For more information and defaults see respective fields in config table.
Parameters
- args:
- text: Text of the notification
- timeout: Time in seconds after which popup expires
- title: Title of the notification
- position: Corner of the workarea the popups will appear
- icon: Path to icon
- icon_size: Desired icon size in px
- fg: Foreground color
- bg: Background color
- screen: Target screen for the notification
- ontop: Target screen for the notification
- run: Function to run on left click
- width: The popup width
- replaces_id: Replace the notification with the given ID
Usage:
naughty.notify({ title = 'Achtung!', text = 'You\'re idling', timeout = 0 })Return value:
The notification object
Tables
- config
- Naughty configuration - a table containing common/default popup settings. You can override some of these for individual popups using args to notify().
Fields
- screen: Screen on which the popups will appear number. Default: 1
- position: Corner of the workarea the popups will appear. Valid values: 'top_right', 'top_left', 'bottom_right', 'bottom_left'. Default: 'top_right'
- padding: Space between popups and edge of the workarea. Default: 4
- width: Width of a popup. Default: 300
- spacing: Spacing between popups. Default: 1
- ontop: Boolean forcing popups to display on top. Default: true
- margin: Space between popup edge and content. Default: 10
- icon_dirs: List of directories that will be checked by getIcon() Default: { "/usr/share/pixmaps/", }
- icon_formats: List of formats that will be checked by getIcon() Default: { "png", "gif" }
- border_width: Border width. Default: 1
- config.presets
- Notification Presets - a table containing presets for different purposes You have to pass a reference of a preset in your notify() call to use the preset At least the default preset named "normal" has to be defined The presets "low", "normal" and "critical" are used for notifications over DBUS
Fields
- low: The preset for notifications with low urgency level
- normal: The default preset for every notification without a preset that will also be used for normal urgency level
- critical: The preset for notifications with a critical urgency level
- notifications[position]
- Index of notifications. See config table for valid 'position' values. Each element is a table consisting of:
Fields
- box: Wibox object containing the popup
- height: Popup height
- width: Popup width
- die: Function to be executed on timeout
- id: Unique notification id based on a counter