Skip to content
Luke Bonham edited this page Jan 29, 2017 · 81 revisions

Usage

Every lain widget is a table.

A lain widget is generated by a function.

The function signature, input and output arguments can be found in the related wiki entry.

Every lain widget contains a wibox.widget, which is updated by a timed function. To access the widget, use the field widget, while to access the timed function, use the field update. Some lain widgets may also have an icon field, which is a wibox.widget.imagebox, and/or a timer field, which is the gears.timer on update.

Every function may take either a table or a list of variables as input.

If the input is a table, you have to define a function variable called settings in it, in order to make your customizations and set widget.

If widget is a textbox, to markup it call widget:set_markup(...) within settings.

settings can use predefined arguments, which are specified in the wiki entries.

Example of a lain widget:

local cpu = lain.widgets.cpu({
    settings = function()
        widget:set_markup("Cpu " .. cpu_now.usage)
    end
})
-- to access the widget: cpu.widget

If you want to see some applications, check awesome-copycats.

Index

Users contributed

Clone this wiki locally