Module awful.util

Utility module for awful

Author:

Julien Danjou <julien@danjou.info>

Copyright© 2008 Julien Danjou

Release: v3.1.2

Functions

checkfile (path) Check if a file is a Lua valid file.
color_strip_alpha (color) Strip alpha part of color.
cycle (t, i) Make i cycle.
escape (text) Escape a string from XML char.
eval (s) Eval Lua code.
mkdir (dir) Create a directory
restart () Try to restart awesome.
spawn (cmd, screen) Spawn a program.
unescape (text) Unescape a string from entities.


Functions

checkfile (path)
Check if a file is a Lua valid file. This is done by loading the content and compiling it with loadfile().

Parameters

  • path: The file path.

Return value:

A function if everything is alright, a string with the error otherwise.
color_strip_alpha (color)
Strip alpha part of color.

Parameters

  • color: The color.

Return value:

The color without alpha channel.
cycle (t, i)
Make i cycle.

Parameters

  • t: A length.
  • i: An absolute index to fit into #t.

Return value:

The object at new index.
escape (text)
Escape a string from XML char. Useful to set raw text in textbox.

Parameters

  • text: Text to escape.

Return value:

Escape text.
eval (s)
Eval Lua code.

Parameters

  • s:

Return value:

The return value of Lua code.
mkdir (dir)
Create a directory

Parameters

  • dir: The directory.

Return value:

mkdir return code
restart ()
Try to restart awesome. It checks if the configuration file is valid, and then restart if it's ok. If it's not ok, the error will be returned.

Return value:

Never return if awesome restart, or return a string error.
spawn (cmd, screen)
Spawn a program.

Parameters

  • cmd: The command.
  • screen: The screen where to spawn window.

Return value:

The awesome.spawn return value.
unescape (text)
Unescape a string from entities.

Parameters

  • text: Text to unescape.

Return value:

Unescaped text.

Valid XHTML 1.0!