sx-cairodeco

sx-cairodeco is a plugin that uses the cairo graphics library to render some nice window decoration.

It’s plugin key is “decoration”.

Dependencies

sx-cairodeco depends on the cairo library and sx-actions.

Configuration

cairodeco.bindings

A dictionary mapping Buttonstrokes to to action lines. The actions are emitted if the user clicks on the title bar. Provided information:

  • screen, the current Screen instance
  • x and
  • y, the coordinates of the button click event.
  • client, the client the frame belongs to.

Default: no bindings.

cairodeco.height

The height of the title bar (int, in pixels).

Required.

cairodeco.title.position

Alignment of the title text (one of “left”, “center”, “right”).

Required.

cairodeco.color

Background color of the titlebar in hexadecimal rgb notation (#RRGGBB, example: #FF0000 for red) for the focused window.

Required.

cairodeco.title.color

Color of the window title in hexadecimal rgb notation for the focused window.

Required.

cairodeco.inactive_color

Background color of the titlebar in hexadecimal rgb notation for inactive (= not focused) windows.

Defaults to the value of cairodeco.color.

cairodeco.title.inactive_color

Color of the window title in hexadecimal rgb notation for inactive windows.

Defaults to the value of cairodeco.title.color.

Example

'cairodeco.bindings': {
        '1': 'moveresize.move',
        '3': 'moveresize.resize',
    },
'cairodeco.height': 15,
'cairodeco.title.position': "center",
'cairodeco.color': '#cc0000',
'cairodeco.title.color': '#ffffff',
'cairodeco.title.inactive_color': '#000000'

Buttonstrokes

Buttonstrokes are similar to Keystrokes, except that they take button indices (1, 2 or 3) instead of keys.

Examples:

1
CTRL+3
Meta+2
ctrl+Shift+1
class sxcairodeco.ClientData(plugin, screen, client)
actor_on_configure_notify(evt)
if the actor is configured, configure the window, too
on_blur(client)
on_button_press(evt)
on_expose(evt)
on_focus(client)
on_map_notify(evt)
on_property_notify(evt)
if a window changes a watched atom, redraw the title bar.
on_unmap_notify(evt)
on_updated_geom(client)
Event handler: called when the client’s geom attribute changed. Resize the surface and redraw.
redraw()
remove()
the end.
screen_on_configure_notify(evt)
window_on_configure_notify(evt)
if the window is configured, configure the actor, too
class sxcairodeco.SXDeco(app)
create_client_data(screen, client)
emit_action(client, evt)
on_load_config(config)
on_new_client(screen, client)
on_ready(app)
on_unmanage_client(screen, client)
sxcairodeco.compute_actor_geom(geom)
convert the ‘window geom’ to the ‘frame geom’
sxcairodeco.compute_window_geom(geom)
convert the ‘frame geom’ to the ‘window geom’
sxcairodeco.hex_to_cairo_color(color)
convert a color in hexadecimal form (e.g. ‘#ff00ee’). return a 3-element tuple of (R, G, B), where R, G and B are 0..255.

samurai-x

Table Of Contents

Previous topic

sx-bookmarks

Next topic

sx-clientbuttons

This Page