Module naughty

Info:

  • Copyright: 2008 koniu
  • Release: v3.5.2
  • Author: koniu <gkusnierz@gmail.com>

Functions

suspend () Suspend notifications
resume () Resume notifications
toggle () Toggle notification state
destroy (notification) Destroy notification by notification object
notify (args) Create notification.

Tables

naughty Notification library
config Naughty configuration - a table containing common popup settings.
naughty.config.icon_dirs List of directories that will be checked by getIcon() **Default:** `{ "/usr/local/share/pixmaps/", }`
naughty.config.icon_formats List of formats that will be checked by getIcon() **Default:** `{ "png", "gif" }`
naughty.config.presets Notification Presets - a table containing presets for different purposes Preset is a table of any parameters available to notify(), overriding default values.
naughty.config.defaults Default values for the params to notify().
naughty.config.mapping DBUS notification to preset mapping The first element is an object containing the filter If the rules in the filter matches the associated preset will be applied The rules object can contain: urgency, category, appname The second element is the preset
notifications Index of notifications per screen and position.

Fields

naughty.config.padding Space between popups and edge of the workarea.
naughty.config.spacing Spacing between popups.
naughty.config.notify_callback Callback used to modify or reject notifications.


Functions

suspend ()
Suspend notifications
resume ()
Resume notifications
toggle ()
Toggle notification state
destroy (notification)
Destroy notification by notification object

Parameters:

  • notification notification Notification object to be destroyed

Returns:

    True if the popup was successfully destroyed, nil otherwise

Usage:

    mynotification = naughty.notify({ text = "An example" })
    naughty.destroy(mynotification)
notify (args)
Create notification.

Parameters:

  • args a dictionary of (optional) arguments:
    • text string Text of the notification.
    • title string Title of the notification.
    • timeout int Time in seconds after which popup expires. Set `0` for no timeout.
    • hover_timeout int Delay in seconds after which hovered popup disappears.
    • screen int Target screen for the notification.
    • position string Corner of the workarea displaying the popups. **Values:** `"top_right"`, `"top_left"`, `"bottom_left"`, `"bottom_right"`.
    • ontop bool Boolean forcing popups to display on top.
    • height int Popup height.
    • width int Popup width.
    • font string Notification font.
    • icon string Path to icon.
    • icon_size int Desired icon size in px.
    • fg string Foreground color.
    • bg string Background color.
    • border_width int Border width.
    • border_color string Border color.
    • run function Function to run on left click.
    • preset table Table with any of the above parameters. Note: Any parameters specified directly in args will override ones defined in the preset.
    • replaces_id int Replace the notification with the given ID
    • callback function function that will be called with all arguments the notification will only be displayed if the function returns true note: this function is only relevant to notifications sent via dbus

Returns:

    The notification object

See also:

Usage:

    naughty.notify({ title = "Achtung!", text = "You're idling", timeout = 0 })

Tables

naughty
Notification library
config
Naughty configuration - a table containing common popup settings.
naughty.config.icon_dirs
List of directories that will be checked by getIcon() **Default:** `{ "/usr/local/share/pixmaps/", }`

Fields:

  • /usr/local/share/pixmaps/
naughty.config.icon_formats
List of formats that will be checked by getIcon() **Default:** `{ "png", "gif" }`

Fields:

  • png
  • gif
naughty.config.presets
Notification Presets - a table containing presets for different purposes Preset is a table of any parameters available to notify(), overriding default values. You have to pass a reference of a preset in your notify() call to use the preset 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

See also:

naughty.config.defaults
Default values for the params to notify(). These can optionally be overridden by specifying a preset

Fields:

  • timeout `5`
  • text `""`
  • screen `1`
  • ontop `true`
  • margin `"5"`
  • border_width `"1"`
  • position `"top_right"`

See also:

naughty.config.mapping
DBUS notification to preset mapping The first element is an object containing the filter If the rules in the filter matches the associated preset will be applied The rules object can contain: urgency, category, appname The second element is the preset

Fields:

  • {
notifications
Index of notifications per screen and position. @see naughty.config table for valid 'position' values. Each element is a table consisting of: * 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

Fields:

  • suspended

Fields

naughty.config.padding
Space between popups and edge of the workarea. **Default:** `4`
naughty.config.spacing
Spacing between popups. **Default:** `1`
naughty.config.notify_callback
Callback used to modify or reject notifications. **Default:** `nil`

Usage:

    naughty.config.notify_callback = function(args)
        args.text = 'prefix: ' .. args.text
        return args
    end
generated by LDoc 1.4.0