Module: awful.permissions

Implements EWMH requests handling.

Info:

  • Copyright: 2009 Julien Danjou
  • Originally authored by: Julien Danjou <julien@danjou.info>
    (Full contributors list available on our github project)

Static module functions

awful.permissions.add_activate_filter (f[, context]) Add an activate (focus stealing) filter function.
awful.permissions.remove_activate_filter (f[, context]) -> boolean Remove an activate (focus stealing) filter function.

Request handlers

awful.permissions.activate Activate a window.
awful.permissions.tag Tag a window with its requested tag.
awful.permissions.urgent Handle client urgent request
awful.permissions.geometry Move and resize the client.
awful.permissions.wibox_geometry Move and resize the wiboxes.
awful.permissions.merge_maximization Merge the 2 requests sent by clients wanting to be maximized.
awful.permissions.client_geometry_requests Allow the client to move itself.
awful.permissions.update_border The default client request::border handler.
awful.permissions.autoactivate Default handler for the request::autoactivate signal.

Theme variables

beautiful.maximized_honor_padding boolean Honor the screen padding when maximizing.
beautiful.fullscreen_hide_border boolean Hide the border on fullscreen clients.
beautiful.maximized_hide_border boolean Hide the border on maximized clients.

Tables

generic_activate_filters The list of all registered generic request::activate (focus stealing) filters.
contextual_activate_filters The list of all registered contextual request::activate (focus stealing) filters.


Static module functions

awful.permissions.add_activate_filter (f[, context])

Add an activate (focus stealing) filter function.

The callback takes the following parameters:

  • c (client) The client requesting the activation
  • context (string) The activation context.
  • hints (table) Some additional hints (depending on the context)

If the callback returns true, the client will be activated. If the callback returns false, the activation request is cancelled unless the force hint is set. If the callback returns nil, the previous callback will be executed. This will continue until either a callback handles the request or when it runs out of callbacks. In that case, the request will be granted if the client is visible.

For example, to block Firefox from stealing the focus, use:

awful.permissions.add_activate_filter(function(c)
    if c.class == "Firefox" then return false end
end, "permissions")

Parameters:

  • f function The callback
  • context string The request::activate context (optional)

See also:

awful.permissions.remove_activate_filter (f[, context]) -> boolean
Remove an activate (focus stealing) filter function. This is an helper to avoid dealing with permissions.add_activate_filter directly.

Parameters:

  • f function The callback
  • context string The request::activate context (optional)

Returns:

    boolean If the callback existed

See also:

Request handlers

awful.permissions.activate
Activate a window.

This sets the focus only if the client is visible. If raise is set in the hints, it will also unminimize the client and move it to the top of its layer.

It is the default signal handler for request::activate on a client.

Arguments:

  • c client A client to use
  • context string The context where this signal was used.
  • hints A table with additional hints:
    • raise boolean should the client be unminimized and raised? (default false)
    • switch_to_tag boolean should the client's first tag be selected if none of the client's tags are selected? (default false)
    • switch_to_tags boolean Select all tags associated with the client. (default false)
awful.permissions.tag
Tag a window with its requested tag.

It is the default signal handler for request::tag on a client.

Arguments:

  • c client A client to tag
  • t tag or boolean A tag to use. If true, then the client is made sticky. (optional)
  • hints table Extra information (default {})
awful.permissions.urgent
Handle client urgent request

Arguments:

  • c client A client
  • urgent boolean If the client should be urgent
awful.permissions.geometry
Move and resize the client.

This is the default geometry request handler.

Arguments:

  • c client The client
  • context string The context
  • hints table The hints to pass to the handler (default {})
awful.permissions.wibox_geometry
Move and resize the wiboxes.

This is the default geometry request handler.

Arguments:

  • w wibox The wibox.
  • context string The context
  • hints table The hints to pass to the handler (default {})
awful.permissions.merge_maximization
Merge the 2 requests sent by clients wanting to be maximized.

The X clients set 2 flags (atoms) when they want to be maximized. This caused 2 request::geometry to be sent. This code gives some time for them to arrive and send a new request::geometry (through the property change) with the combined state.

Arguments:

  • c client The client
  • context string The context
  • hints table The hints to pass to the handler (default {})
awful.permissions.client_geometry_requests
Allow the client to move itself.

This is the default geometry request handler when the context is permissions.

Arguments:

  • c client The client
  • context string The context
  • hints table The hints to pass to the handler (default {})
awful.permissions.update_border · 58 theme variables
The default client request::border handler.

To replace this handler with your own, use:

client.disconnect_signal("request::border", awful.ewmh.update_border)

The default implementation chooses from dozens beautiful theme variables depending if the client is tiled, floating, maximized and then from its state (urgent, new, active, normal)

Click to display more

Consumed theme variables:

Theme variable Usage
beautiful.border_color_marked
beautiful.border_color_active
beautiful.border_color_normal
beautiful.border_color_new
beautiful.border_color_urgent
beautiful.border_color_floating
beautiful.border_color_floating_active
beautiful.border_color_floating_normal
beautiful.border_color_floating_new
beautiful.border_color_floating_urgent
beautiful.border_color_maximized
beautiful.border_color_maximized_active
beautiful.border_color_maximized_normal
beautiful.border_color_maximized_new
beautiful.border_color_maximized_urgent
beautiful.border_color_fullscreen
beautiful.border_color_fullscreen_active
beautiful.border_color_fullscreen_normal
beautiful.border_color_fullscreen_new
beautiful.border_color_fullscreen_urgent
beautiful.border_width_active
beautiful.border_width_normal
beautiful.border_width_new
beautiful.border_width_urgent
beautiful.border_width_floating
beautiful.border_width_floating_active
beautiful.border_width_floating_normal
beautiful.border_width_floating_new
beautiful.border_width_floating_urgent
beautiful.border_width_maximized
beautiful.border_width_maximized_active
beautiful.border_width_maximized_normal
beautiful.border_width_maximized_new
beautiful.border_width_maximized_urgent
beautiful.border_width_fullscreen
beautiful.border_width_fullscreen_active
beautiful.border_width_fullscreen_normal
beautiful.border_width_fullscreen_new
beautiful.border_width_fullscreen_urgent
beautiful.opacity_floating
beautiful.opacity_floating_active
beautiful.opacity_floating_normal
beautiful.opacity_floating_new
beautiful.opacity_floating_urgent
beautiful.opacity_maximized
beautiful.opacity_maximized_active
beautiful.opacity_maximized_normal
beautiful.opacity_maximized_new
beautiful.opacity_maximized_urgent
beautiful.opacity_fullscreen
beautiful.opacity_fullscreen_active
beautiful.opacity_fullscreen_normal
beautiful.opacity_fullscreen_new
beautiful.opacity_fullscreen_urgent
beautiful.opacity_active
beautiful.opacity_normal
beautiful.opacity_new
beautiful.opacity_urgent
awful.permissions.autoactivate

Default handler for the request::autoactivate signal.

All it does is to emit request::activate with the following context mapping:

  • mouse_enter: mouse.enter
  • switchtag : *autofocus.checkfocus_tag*
  • history : *autofocus.check_focus*

Theme variables

beautiful.maximized_honor_padding boolean
Honor the screen padding when maximizing.
beautiful.fullscreen_hide_border boolean
Hide the border on fullscreen clients.
beautiful.maximized_hide_border boolean
Hide the border on maximized clients.

Tables

generic_activate_filters
The list of all registered generic request::activate (focus stealing) filters. If a filter is added to only one context, it will be in permissions.contextual_activate_filters["context_name"].

See also:

contextual_activate_filters
The list of all registered contextual request::activate (focus stealing) filters. If a filter is added to only one context, it will be in permissions.generic_activate_filters.

See also:

generated by LDoc 1.4.6 Last updated 2021-11-13 00:35:50