Module naughty
Notification library
Author:
koniu <gkusnierz@gmail.com> |
Copyright© 2008 koniu
Release: v3.1.2
Functions
arrange (screen) | Re-arrange notifications according to their position and index - internal |
destroy (notification) | Destroy notification by index |
get_offset (screen, position, idx, width, height) | Evaluate desired position of the notification by index - internal |
notify (args, text, timeout, title, position, icon, icon_size, fg, bg, screen, ontop, run, width) | Create notification. |
Tables
config | Naughty configuration - a table containing common/default popup settings. |
notifications[position] | Index of notifications. |
Functions
- arrange (screen)
-
Re-arrange notifications according to their position and index - internal
Parameters
- screen:
Return value:
None - destroy (notification)
-
Destroy notification by index
Parameters
- notification: Notification object to be destroyed
Return value:
True if the popup was successfully destroyed, nil otherwise - get_offset (screen, position, idx, width, height)
-
Evaluate desired position of the notification by index - internal
Parameters
- screen:
- position: top_right | top_left | bottom_right | bottom_left
- idx: Index of the notification
- width: Popup width (optional)
- height: Popup height
Return value:
Absolute position in {x, y} dictionary - notify (args, text, timeout, title, position, icon, icon_size, fg, bg, screen, ontop, run, width)
-
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
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
- timeout: Number of seconds after which popups disappear. Set to 0 for no timeout. Default: 5
- 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
- height: Height of a single line of text. Default: 16
- 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
- font: Popup font. Default: beautiful.font or "Verdana 8"
- icon: Popup icon. Default: nil
- icon_size: Size of the icon in pixels. Default: 16
- fg: Foreground color. Default: beautiful.fg_focus or '#ffffff'
- bg: Background color. Default: beautiful.bg_focus or '#535d6c'
- border_color: Border color. Default: beautiful.border_focus or '#535d6c'
- border_width: Border width. Default: 1
- hover_timeout: Delay in seconds after which hovered popup disappears. Default: nil
- 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