awesome API documentation

# Module `awesome`

awesome core API

### Info:

- Copyright: 2008-2009 Julien Danjou
- Author: Julien Danjou <julien@danjou.info>

## Functions

quit ([code=0]) | Quit awesome.
exec (cmd) | Execute another application, probably a window manager, to replace awesome.
restart () | Restart awesome.
kill (pid, sig) | Send a signal to a process identified by its process id.
load_image (name) | Load an image from a given path.
set_preferred_icon_size (size) | Set the preferred size for client icons.
connect_signal (name, func) | Add a global signal.
disconnect_signal (name, func) | Remove a global signal.
emit_signal (name, ...) | Emit a global signal.
spawn (cmd[, use_sn=true[, stdin=false[, stdout=false[, stderr=false[, exit_callback=nil]]]]]) | Spawn a program.
xkb_set_layout_group (num) | Switch keyboard layout.
xkb_get_layout_group () | Get current layout number.
xkb_get_group_names () | Get layout short names.

## Signals

debug::error | A call into the lua code aborted with an error
debug::deprecation | A deprecated lua function was called
debug::index::miss | An invalid key was read from an object (e.g.
debug::newindex::miss | An invalid key was written to an object (e.g.
systray::update |
wallpaper_changed |
xkb::map_changed |
xkb::group_changed |
refresh |
startup |
exit |
screen::change |
spawn::canceled | For some reason the application aborted startup
spawn::change | When one of the fields from the spawn::initiated table changes
spawn::completed | An application finished starting
spawn::initiated | When a new client is beginning to start
spawn::timeout | An application started a spawn event but didn't start in time.

## Fields

version | The version of awesome.
release | The release name of awesome.
conffile | The configuration file which has been loaded.
startup | True if we are still in startup, false otherwise.
startup_errors | Error message for errors that occured during startup.
composite_manager_running | True if a composite manager is running.
unix_signal | Table mapping between signal numbers and signal identifiers.
hostname | The hostname of the computer on which we are running.

## Functions

Methods

quit ([code=0])
  Quit awesome.
  - code integer The exit code to use when exiting. (default 0)
exec (cmd)
  Execute another application, probably a window manager, to replace awesome.
  - cmd The command line to execute.
restart ()
  Restart awesome.
kill (pid, sig)
  Send a signal to a process identified by its process id. See awesome.unix_signal for a list of signals.
  - pid integer Process identifier
  - sig integer Signal number

  ### Returns:

  boolean true if the signal was successfully sent, else false
load_image (name)
  Load an image from a given path.
  - name The file name.

  ### Returns:

  A cairo surface as light user datum.

  ### Or

  1. nil
  2. string Error message
set_preferred_icon_size (size)
  Set the preferred size for client icons.

  The closest equal or bigger size is picked if present, otherwise the closest smaller size is picked. The default is 0 pixels, ie. the smallest icon.

  - size The size of the icons in pixels.
connect_signal (name, func)
  Add a global signal.
  - name A string with the event name.
  - func The function to call.
disconnect_signal (name, func)
  Remove a global signal.
  - name A string with the event name.
  - func The function to call.
emit_signal (name, ...)
  Emit a global signal.
  - name A string with the event name.
  - ... The signal arguments.
spawn (cmd[, use_sn=true[, stdin=false[, stdout=false[, stderr=false[, exit_callback=nil]]]]])
  Spawn a program. The program will be started on the default screen.
  - cmd string or table The command to launch.
  - use_sn boolean Use startup-notification? (default true)
  - stdin boolean Return a fd for stdin? (default false)
  - stdout boolean Return a fd for stdout? (default false)
  - stderr boolean Return a fd for stderr? (default false)
  - exit_callback function Function to call on process exit. The function arguments will be type of exit ("exit" or "signal") and the exit code / the signal number causing process termination. (default nil)

  ### Returns:

  1. integer Process ID if everything is OK.
  2. string Startup-notification ID, if `use_sn` is true.
  3. integer stdin, if `stdin` is true.
  4. integer stdout, if `stdout` is true.
  5. integer stderr, if `stderr` is true.

  ### Or

  string An error string if an error occured.
xkb_set_layout_group (num)
  Switch keyboard layout.
  - num integer keyboard layout number, integer from 0 to 3
xkb_get_layout_group ()
  Get current layout number.

  ### Returns:

  integer num Current layout number, integer from 0 to 3.
xkb_get_group_names ()
  Get layout short names.

  ### Returns:

  string A string describing the current layout settings, e.g.: 'pc+us+de:2+inet(evdev)+group(altshifttoggle)+ctrl(nocaps)'

## Signals

debug::error
  A call into the lua code aborted with an error
debug::deprecation
  A deprecated lua function was called
debug::index::miss
  An invalid key was read from an object (e.g. c.foo)
debug::newindex::miss
  An invalid key was written to an object (e.g. c.foo = "bar")
systray::update
wallpaper_changed
xkb::map_changed
xkb::group_changed
refresh
startup
exit
screen::change
spawn::canceled
  For some reason the application aborted startup

  ### Arguments:

  - arg Table which only got the "id" key set
spawn::change
  When one of the fields from the spawn::initiated table changes

  ### Arguments:

  - arg Table which describes the spawn event
spawn::completed
  An application finished starting

  ### Arguments:

  - arg Table which only got the "id" key set
spawn::initiated
  When a new client is beginning to start

  ### Arguments:

  - arg Table which describes the spawn event
spawn::timeout
  An application started a spawn event but didn't start in time.

  ### Arguments:

  - arg Table which only got the "id" key set

## Fields

version
  The version of awesome.
  - version string
release
  The release name of awesome.
  - release string
conffile
  The configuration file which has been loaded.
  - conffile string
startup
  True if we are still in startup, false otherwise.
  - startup boolean
startup_errors
  Error message for errors that occured during startup.
  - startup_errors string
composite_manager_running
  True if a composite manager is running.
  - composite_manager_running boolean
unix_signal
  Table mapping between signal numbers and signal identifiers.
  - unix_signal table
hostname
  The hostname of the computer on which we are running.
  - hostname string

generated by LDoc 1.4.6 Last updated 2017-01-19 17:31:36