Module: naughty.layout.box

A notification popup widget.

By default, the box is composed of many other widgets:

Usage example

Info:

  • Copyright: 2017 Emmanuel Lepage Vallee
  • Author: Emmanuel Lepage Vallee <[email protected]>

Object properties

notification N/A The widget notification object.
widget_template widget The widget template to construct the box content.
border_width integer Border width.
border_color string Border color.
ontop boolean On top of other windows.
cursor string The mouse cursor.
visible boolean Visibility.
opacity number The opacity of the wibox, between 0 and 1.
type string The window type (desktop, normal, dock, …).
x integer The x coordinates.
y integer The y coordinates.
width width The width of the wibox.
height height The height of the wibox.
screen screen The wibox screen.
drawable drawable The wibox’s drawable.
widget widget The widget that the wibox displays.
window string The X window id.
shape_bounding N/A The wibox’s bounding shape as a (native) cairo surface.
shape_clip N/A The wibox’s clip shape as a (native) cairo surface.
shape_input N/A The wibox’s input shape as a (native) cairo surface.
shape gears.shape The wibar’s shape.
input_passthrough boolean Forward the inputs to the client below the wibox.
bg c The background of the wibox.
bgimage image The background image of the drawable.
fg c The foreground (text) of the wibox.

Object methods

:buttons (buttons_table) Get or set mouse buttons bindings to a wibox.
:geometry (A) Get or set wibox geometry.
:struts (strut) Get or set wibox struts.
:setup {[args]} Set a declarative widget hierarchy description.
:find_widgets (x, y) Find a widget by a point.

Theme variables

beautiful.notification_max_width number The maximum notification width.
beautiful.notification_position string The maximum notification position.
beautiful.bg_normal color The default background color.
beautiful.fg_normal color The default foreground (text) color.


Object properties

notification (N/A)
The widget notification object.
widget_template (widget)

The widget template to construct the box content.

Usage example

The default template is (less or more):

{
    {
        {
            {
                {
                    naughty.widget.icon,
                    {
                        naughty.widget.title,
                        naughty.widget.message,
                        spacing = 4,
                        layout  = wibox.layout.fixed.vertical,
                    },
                    fill_space = true,
                    spacing    = 4,
                    layout     = wibox.layout.fixed.horizontal,
                },
                naughty.list.actions,
                spacing = 10,
                layout  = wibox.layout.fixed.vertical,
            },
            margins = beautiful.notification_margin,
            widget  = wibox.container.margin,
        },
        id     = "background_role",
        widget = naughty.container.background,
    },
    strategy = "max",
    width    = width(beautiful.notification_max_width
        or beautiful.xresources.apply_dpi(500)),
    widget   = wibox.container.constraint,
}
border_width (integer)

Border width.

Signal:

  • property::border_width
border_color (string)

Border color.

Please note that this property only support string based 24 bit or 32 bit colors:

Red Blue
 _|  _|
#FF00FF
   T‾
 Green


Red Blue
 _|  _|
#FF00FF00
   T‾  ‾T
Green   Alpha

Signal:

  • property::border_color
ontop (boolean)

On top of other windows.

Signal:

  • property::ontop
cursor (string)

The mouse cursor.

Signal:

  • property::cursor

See also:

visible (boolean)

Visibility.

Signal:

  • property::visible
opacity (number)

The opacity of the wibox, between 0 and 1.

Signal:

  • property::opacity

Type constraints:

  • opacity number (between 0 and 1)
type (string)

The window type (desktop, normal, dock, …).

Signal:

  • property::type

See also:

x (integer)

The x coordinates.

Signal:

  • property::x
y (integer)

The y coordinates.

Signal:

  • property::y
width (width)

The width of the wibox.

Signal:

  • property::width
height (height)

The height of the wibox.

Signal:

  • property::height
screen (screen)
The wibox screen.
drawable (drawable)

The wibox’s drawable.

Signal:

  • property::drawable
widget (widget)
The widget that the wibox displays.
window (string)

The X window id.

Signal:

  • property::window

See also:

shape_bounding (N/A)

The wibox’s bounding shape as a (native) cairo surface.

Signal:

  • property::shape_bounding
shape_clip (N/A)

The wibox’s clip shape as a (native) cairo surface.

Signal:

  • property::shape_clip
shape_input (N/A)

The wibox’s input shape as a (native) cairo surface.

Signal:

  • property::shape_input
shape (gears.shape)

The wibar’s shape.

Signal:

  • property::shape
input_passthrough (boolean)

Forward the inputs to the client below the wibox.

This replace the shape_input mask with an empty area. All mouse and keyboard events are sent to the object (such as a client) positioned below this wibox. When used alongside compositing, it allows, for example, to have a subtle transparent wibox on top a fullscreen client to display important data such as a low battery warning.

Signal:

  • property::input_passthrough

See also:

bg (c)
The background of the wibox.

Type constraints:

  • c The background to use. This must either be a cairo pattern object, nil or a string that gears.color() understands.
  • color

See also:

bgimage (image)
The background image of the drawable. If image is a function, it will be called with (context, cr, width, height) as arguments. Any other arguments passed to this method will be appended.

Type constraints:

  • image A background image or a function

See also:

fg (c)
The foreground (text) of the wibox.

Type constraints:

  • c The foreground to use. This must either be a cairo pattern object, nil or a string that gears.color() understands.
  • color

See also:

Object methods

:buttons (buttons_table)
Get or set mouse buttons bindings to a wibox.

Parameters:

  • buttons_table A table of buttons objects, or nothing.
:geometry (A)
Get or set wibox geometry. That’s the same as accessing or setting the x, y, width or height properties of a wibox.

Parameters:

  • A table with coordinates to modify.

Returns:

    A table with wibox coordinates and geometry.
:struts (strut)
Get or set wibox struts.

Parameters:

  • strut A table with new strut, or nothing

Returns:

    The wibox strut in a table.

See also:

:setup {[args]}
Set a declarative widget hierarchy description. See The declarative layout system

Parameters:

  • args An array containing the widgets disposition
:find_widgets (x, y)
Find a widget by a point. The wibox must have drawn itself at least once for this to work.

Parameters:

  • x number X coordinate of the point
  • y number Y coordinate of the point

Returns:

    table A sorted table of widgets positions. The first element is the biggest container while the last is the topmost widget. The table contains x, y, width, height and widget.

Theme variables

beautiful.notification_max_width (number)
The maximum notification width.
beautiful.notification_position (string)

The maximum notification position.

Valid values are:

  • top_left
  • top_middle
  • top_right
  • bottom_left
  • bottom_middle
  • bottom_right
beautiful.bg_normal (color)
The default background color.

See also:

beautiful.fg_normal (color)
The default foreground (text) color.

See also:

generated by LDoc 1.4.6 Last updated 2030-01-01 00:00:00