Skip to content

Commit

Permalink
Updated documentation support files (README, man page, luadoc files).
Browse files Browse the repository at this point in the history
  • Loading branch information
David Soulayrol committed Apr 13, 2011
1 parent 474d480 commit 4f7ad0f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 79 deletions.
51 changes: 3 additions & 48 deletions README
@@ -1,9 +1,6 @@
This is Flaw, a Lua OO management framework for Awesome WM widgets.

Flaw stands for Fully Loaded AWesome. It is a LUA object oriented
library providing a thin abstraction layer above awesome widgets and
refresh mechanisms. It is aimed at being simple and resources
efficient.
Flaw is a LUA object oriented library providing a thin abstraction
layer above awesome widgets. It is aimed at being simple and resources
efficient. See <http://david.soulayrol.name/projects/flaw/>.

Flaw requires luafilesystem. To learn more, please read the provided
flaw(7) man page. You can read it without installing it on the system
Expand All @@ -18,46 +15,4 @@ documentation pages.

LUA_PATH="path_toflaw/doclet/html/?;;" luadoc -d html --nofiles *.lua

For the most impatient or curious, here is a quick glance at flaw
usage:

require('flaw')

-- Create battery monitor icon
g_bat_icon = flaw.gadget.new('flaw.battery.imagebox', 'BAT0')
g_bat_icon.add_event(
flaw.event.LatchTriger:new{condition = function(d) return d.load < 75 end},
function(g) g.widget.image = image(beautiful.battery_icon) end
)
g_bat_icon.add_event(
flaw.event.LatchTriger:new{condition = function(d) return d.load < 25 end},
function(g) g.widget.image = image(beautiful.battery_low_icon) end
)
g_bat_icon.add_event(
flaw.event.LatchTriger:new{condition = function(d) return d.load < 10 end},
function(g) naughty.notify{
title = "Battery Warning",
text = "Battery low! " .. g.provider.data.load .. "% left!",
timeout = 5, position = "top_right",
fg = beautiful.fg_focus, bg = beautiful.bg_focus} end
)
g_bat_icon.add_event(
flaw.event.LatchTriger:new{condition =
function(d) return d.status == flaw.battery.STATUS_CHARGING end},
function(g) g.widget.image = image(beautiful.battery_load_icon) end
)

-- Create battery monitor textbox
g_bat_text = flaw.gadget.new('flaw.battery.textbox', 'BAT0')
g_bat_text.add_event(
flaw.event.LatchTriger:new{ condition = function(d) return d.load < 10 end },
function(g) g.pattern = '<bg color="#ff6565"/>$load%' end
)

wibox.widgets = {
g_bat_icon.widget,
w_bat_text.widget,
}


-- David Soulayrol <david.soulayrol AT gmail DOT net>
40 changes: 27 additions & 13 deletions flaw.7
Expand Up @@ -19,7 +19,7 @@ To add functionality to awesome widgets,
defines gadget objects, which are a wrapper around a widget. All
gadgets have properties, events, a refresh mechanism and a data
provider (see below). Gadgets can wrap all awesome widget type,
namely text boxes, image boxes or graphs.
namely text boxes, image boxes, graphs or progress bars.
.B flaw
provides many gadgets for common system information (like CPU or
memory activity).
Expand All @@ -38,21 +38,35 @@ trigger, which computes the condition, and an action. Event triggers
are tested by the providers only when data changes. Both the
condition and the action are provided by the user.
.SH USAGE
Before anything else, insert require('flaw') in your configuration file.
.SS The flaw API
.IP flaw.gadget.new
.SH WIDGET TYPES
.SS Battery
.SS CPU
.SS Memory
.SS Network

.SH EXAMPLES

.B flaw
depends on the
.RB lua-filesystem
package which can be found
.IR http://luaforge.net/projects/luafilesystem .
Once installed, the following statement must be inserted in awesome
configuration before any
.B flaw
gadget or mechanism is used.
.RS
\f(CWrequire('flaw')\fP
.RE
.PP
Using
.B flaw
consists in creating gadgets, passing them parameters to customize their
display and events to add some behaviour to them, and then adding them
in a wibox like any other awesome widget.
.B flaw
and awful gadgets can live together. The complete
.B flaw
documentation is available in Luadoc format. Enter the following command to generate it.
.RS
\f(CWLUA_PATH="path_toflaw/doclet/html/?;;" luadoc -d html --nofiles *.lua\fP
.RE
.SH DIAGNOSTICS
.B flaw
tries to recover upon bad invocations. When something wrong occurs, it
outpus warning or error messages to stderr (for example, if awesome
outputs warning or error messages to stderr (for example, if awesome
was started with xsession, output will be found in
.I ~/.xsession-errors
).
Expand Down
26 changes: 10 additions & 16 deletions luadoc/doclet/html/index.lp
Expand Up @@ -37,20 +37,22 @@
you to write new system resources interfaces or to
automate the configuration of new widgets.
</p>

<h2>Installation</h2>
<p>
To start using <b>flaw</b>, simply add the following
requirement at the top of your <b>awesome</b> configuration
file. You will find many code samples in the module
descriptions.
The source code of <b>flaw</b> is hosted
on <a href="http://github.com">GitHub</a> and can be
browsed <a href="http://github.com/dsoulayrol/flaw">here</a>. There
is neither archive nor stable release at this time.
</p>
<div class='example'>require('flaw')</div>
<p>
<i>Please note:</i> <b>flaw</b> tries to remain as easy as
possible to install. However, to keep some things simple,
it relies on <b>lua-filesystem</b> which can be found
The only dependency of <b>flaw</b>, besides the need to
run it inside <b>awesome</b> of course, is
the <b>lua-filesystem</b> package which can be found
at <a href="http://luaforge.net/projects/luafilesystem">LuaForge.net</a>.
</p>
<%if not options.nomodules and #doc.modules > 0 then%>

<h2>Documentation</h2>
<table class="module_list">
<tr><th colspan="2">Modules</th></tr>
Expand All @@ -63,14 +65,6 @@
</table>
<%end%>

<h2>Download</h2>
<p>
The source code of <b>flaw</b> is hosted
on <a href="http://github.com">GitHub</a> and can be
browsed <a href="http://github.com/dsoulayrol/flaw">here</a>. There
is neither archive nor stable release at this time.
</p>

<h2>Credits and License</h2>
<p>
The <a href="http://awesome.naquadah.org/wiki/Main_Page">awesome
Expand Down
4 changes: 2 additions & 2 deletions luadoc/doclet/html/luadoc.css
Expand Up @@ -20,8 +20,8 @@ h1, h2, h3, h4 { margin-left: 0em; }
textarea, pre, tt { font-size:10pt; }
body, td, th { color:#000000; }
small { font-size:0.85em; }
h1 { font-size:1.5em; }
h2 { font-size:1.25em; }
h1 { font-size:2em; }
h2 { font-size:1.5em; }
h3 { font-size:1.15em; }
h4 { font-size:1.06em; }

Expand Down

0 comments on commit 4f7ad0f

Please sign in to comment.