Merge branch 'docs-overhaul'
Closes https://github.com/awesomeWM/awesome/pull/146
This commit is contained in:
commit
98dd0d6b63
62
AUTHORS
62
AUTHORS
|
@ -1,62 +0,0 @@
|
|||
|
||||
awesome - awesome window manager
|
||||
|
||||
Author:
|
||||
|
||||
© 2007-2009 Julien Danjou <julien@danjou.info>
|
||||
|
||||
Contributors:
|
||||
|
||||
© 2007-2009 Nikos Ntarmos <ntarmos@ceid.upatras.gr>
|
||||
© 2007-2009 Arnaud Fontaine <arnau@debian.org>
|
||||
© 2008-2009 Damien Leone <damien.leone@gmail.com>
|
||||
© 2008-2009 Gregor Best <farhaven@googlemail.com>
|
||||
© 2008-2009 Maarten Maathuis <madman2003@gmail.com>
|
||||
© 2008-2009 koniu <gkusnierz@gmail.com>
|
||||
© 2009 Uli Schlachter <psychon@znc.in>
|
||||
|
||||
Past contributors:
|
||||
|
||||
© 2007-2008 Marco Candrian <mac@calmar.ws>
|
||||
© 2008 Lucas de Vries <lucasdevries@gmail.com>
|
||||
© 2008 Pierre Habouzit <madcoder@debian.org>
|
||||
© 2008 Félix C. Morency <felix.morency@gmail.com>
|
||||
© 2008 Michael Gehring <mg@ebfe.org>
|
||||
© 2008 Hans Ulrich Niedermann <hun@n-dimensional.de>
|
||||
© 2007 Aldo Cortesi <aldo@nullcube.com>
|
||||
|
||||
License:
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Originally based on dwm code:
|
||||
|
||||
MIT/X Consortium License
|
||||
|
||||
© 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
|
||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
© 2006-2007 Jukka Salmi <jukka at salmi dot ch>
|
||||
© 2007 Premysl Hruby <dfenze at gmail dot com>
|
||||
© 2007 Szabolcs Nagy <nszabolcs at gmail dot com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
|
@ -27,10 +27,12 @@ set(AWE_CONF_FILE rc.lua)
|
|||
set(AWE_ICON_DIR ${SOURCE_DIR}/icons)
|
||||
set(AWE_THEMES_DIR ${SOURCE_DIR}/themes)
|
||||
|
||||
set(AWE_DOC_DIR ${BUILD_DIR}/docs)
|
||||
|
||||
set(AWE_DOC_FILES
|
||||
${SOURCE_DIR}/AUTHORS
|
||||
${SOURCE_DIR}/BUGS
|
||||
${SOURCE_DIR}/README.md
|
||||
${AWE_DOC_DIR}/00-authors.md
|
||||
${AWE_DOC_DIR}/01-readme.md
|
||||
${AWE_DOC_DIR}/02-contributing.md
|
||||
${SOURCE_DIR}/LICENSE)
|
||||
|
||||
set(AWE_SRCS
|
||||
|
@ -237,12 +239,13 @@ if(GENERATE_DOC)
|
|||
file(MAKE_DIRECTORY ${BUILD_DIR}/lib)
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE AWE_LUA_FILES ${BUILD_DIR}/lib/*.lua ${BUILD_DIR}/luadoc/*.lua)
|
||||
file(GLOB_RECURSE AWE_LUA_FILES ${BUILD_DIR}/lib/*.lua ${AWE_DOC_DIR}/capi/*.lua)
|
||||
file(GLOB_RECURSE AWE_MD_FILES ${AWE_DOC_DIR}/*.md)
|
||||
|
||||
add_custom_target(ldoc ALL
|
||||
COMMAND ${LDOC_EXECUTABLE} .
|
||||
WORKING_DIRECTORY ${BUILD_DIR}
|
||||
DEPENDS ${AWE_LUA_FILES})
|
||||
WORKING_DIRECTORY ${AWE_DOC_DIR}
|
||||
DEPENDS ${AWE_LUA_FILES} ${AWE_MD_FILES})
|
||||
endif()
|
||||
# }}}
|
||||
|
||||
|
@ -335,4 +338,4 @@ if(BUSTED_EXECUTABLE)
|
|||
endif()
|
||||
# }}}
|
||||
|
||||
# vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
# vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80:foldmethod=marker
|
||||
|
|
29
PATCHES
29
PATCHES
|
@ -1,29 +0,0 @@
|
|||
If you plan to submit patches, here's a checklist:
|
||||
|
||||
Commits:
|
||||
|
||||
- make commits of logical units;
|
||||
- do not modify piece of code not related to your commit;
|
||||
- do not try to fix style of code you are not writing,
|
||||
it's just adding noise for no gain;
|
||||
- check for unnecessary whitespace with "git diff --check" before commiting;
|
||||
- do not check in commented out code or unneeded files;
|
||||
- provide a meaningful commit message;
|
||||
- the first line of the commit message should be a short;
|
||||
description and should skip the full stop;
|
||||
- if you want your work included, add a
|
||||
"Signed-off-by: Your Name <you@example.com>" line to the
|
||||
commit message (or just use the option "-s" when commiting);
|
||||
- make sure that you have tests for the bug you are fixing.
|
||||
- if possible, add a unit test to the test suite under spec/.
|
||||
|
||||
Patch:
|
||||
|
||||
- use "git format-patch -M" to create the patch;
|
||||
- do not PGP sign your patch;
|
||||
- be careful doing cut & paste into your mailer, not to corrupt whitespaces;
|
||||
- if you change, add or remove the user API, the associated documentation
|
||||
should be updated as well;
|
||||
- send the patch to the list (awesome-devel@naquadah.org) if (and only if)
|
||||
the patch is ready for inclusion. If you use git-send-email(1), please
|
||||
test it first by sending email to yourself.
|
51
README.md
51
README.md
|
@ -1,51 +0,0 @@
|
|||
awesome
|
||||
=======
|
||||
awesome is a highly configurable, next generation framework window manager for X.
|
||||
|
||||
Building and installation
|
||||
-------------------------
|
||||
After extracting the dist tarball, run:
|
||||
|
||||
make
|
||||
|
||||
This will create a build directory, run cmake in it and build awesome.
|
||||
|
||||
After building is finished, you can install:
|
||||
|
||||
make install # you might need root permissions
|
||||
|
||||
Running awesome
|
||||
---------------
|
||||
You can directly select awesome from your display manager. If not, you can
|
||||
add the following line to your .xinitrc to start awesome using startx
|
||||
or to .xsession to start awesome using your display manager:
|
||||
|
||||
exec awesome
|
||||
|
||||
In order to connect awesome to a specific display, make sure that
|
||||
the DISPLAY environment variable is set correctly, e.g.:
|
||||
|
||||
DISPLAY=foo.bar:1 exec awesome
|
||||
|
||||
(This will start awesome on display :1 of the host foo.bar.)
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
The configuration of awesome is done by creating a
|
||||
`$XDG_CONFIG_HOME/awesome/rc.lua` file.
|
||||
|
||||
An example configuration named "awesomerc.lua.in" is provided in the source.
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
In most systems any message printed by awesome (including warnings and errors)
|
||||
are written to `$HOME/.xsession-errors`.
|
||||
|
||||
If awesome does not start or the configuration file is not producing the
|
||||
desired results the user should examine this file to gain insight into the
|
||||
problem.
|
||||
|
||||
Reporting issues
|
||||
----------------
|
||||
Please report any issues you may find at https://github.com/awesomeWM/awesome/issues.
|
||||
You can submit pull requests at https://github.com/awesomeWM/awesome.
|
31
STYLE
31
STYLE
|
@ -1,31 +0,0 @@
|
|||
If you intend to patch and contribute to awesome, please respect the
|
||||
following guidelines.
|
||||
|
||||
Imitate the existing code style. For concrete rules:
|
||||
|
||||
- Use 4 spaces indentation, do not use tabulator characters;
|
||||
|
||||
- Place braces alone on new lines, and do not place braces for single
|
||||
line statement where it is not needed, i.e no:
|
||||
if(bla) {
|
||||
x = 1;
|
||||
}
|
||||
|
||||
- Do not put a space after if, for, while or function call statements;
|
||||
|
||||
- The preferred line length is 80 characters;
|
||||
|
||||
- Use /* */ for comments;
|
||||
|
||||
- Use the API: there's a list of a_*() function you should use instead
|
||||
of the standard libc ones. There is also common API for linked list,
|
||||
tabulars, etc;
|
||||
|
||||
- Be clear in what you do;
|
||||
|
||||
- Prefix your function name with the module they are enhancing,
|
||||
i.e. if you add a function to manipulate a tag prefix it with tag_.
|
||||
|
||||
- Write documentation for any new functions, options, whatever.
|
||||
|
||||
A vim modeline is set in each file to respect this.
|
|
@ -272,11 +272,16 @@ set(AWESOME_THEMES_PATH ${AWESOME_DATA_PATH}/themes)
|
|||
# }}}
|
||||
|
||||
# {{{ Configure files
|
||||
file(GLOB_RECURSE awesome_lua_configure_files RELATIVE ${SOURCE_DIR} ${SOURCE_DIR}/lib/*.lua.in ${SOURCE_DIR}/themes/*/*.lua.in)
|
||||
file(GLOB_RECURSE awesome_lua_configure_files RELATIVE
|
||||
${SOURCE_DIR}
|
||||
${SOURCE_DIR}/lib/*.lua.in
|
||||
${SOURCE_DIR}/docs/capi/*.lua.in
|
||||
${SOURCE_DIR}/docs/*.md
|
||||
${SOURCE_DIR}/themes/*/*.lua.in)
|
||||
set(AWESOME_CONFIGURE_FILES
|
||||
${awesome_lua_configure_files}
|
||||
config.h.in
|
||||
config.ld.in
|
||||
docs/config.ld.in
|
||||
awesomerc.lua.in
|
||||
awesome-version-internal.h.in
|
||||
awesome.doxygen.in)
|
||||
|
@ -295,4 +300,4 @@ foreach(file ${AWESOME_CONFIGURE_FILES})
|
|||
endforeach()
|
||||
#}}}
|
||||
|
||||
# vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
# vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80:foldmethod=marker
|
||||
|
|
13
config.ld.in
13
config.ld.in
|
@ -1,13 +0,0 @@
|
|||
-- Configuration file for ldoc
|
||||
project='awesome'
|
||||
title='awesome API documentation'
|
||||
description='highly configurable X window manager'
|
||||
--format='markdown' or should it be discount? what is that anyway? how about plain?
|
||||
dir='doc'
|
||||
file={ 'lib/', '@SOURCE_DIR@/luadoc' }
|
||||
|
||||
-- Setup @client to be an alias for "@tparam client.client"
|
||||
tparam_alias('client', 'client.client')
|
||||
|
||||
-- Should be default, but is not. Sets up "@tab" => "@tparam table".
|
||||
tparam_alias('tab', 'table')
|
|
@ -0,0 +1,64 @@
|
|||
# Authors
|
||||
|
||||
|
||||
## awesome - awesome window manager
|
||||
|
||||
**Author**:
|
||||
|
||||
* © 2007-2009 Julien Danjou <julien@danjou.info>
|
||||
|
||||
**Contributors**:
|
||||
|
||||
* © 2007-2009 Nikos Ntarmos <ntarmos@ceid.upatras.gr>
|
||||
* © 2007-2009 Arnaud Fontaine <arnau@debian.org>
|
||||
* © 2008-2009 Damien Leone <damien.leone@gmail.com>
|
||||
* © 2008-2009 Gregor Best <farhaven@googlemail.com>
|
||||
* © 2008-2009 Maarten Maathuis <madman2003@gmail.com>
|
||||
* © 2008-2009 koniu <gkusnierz@gmail.com>
|
||||
* © 2009 Uli Schlachter <psychon@znc.in>
|
||||
|
||||
**Past contributors**:
|
||||
|
||||
* © 2007-2008 Marco Candrian <mac@calmar.ws>
|
||||
* © 2008 Lucas de Vries <lucasdevries@gmail.com>
|
||||
* © 2008 Pierre Habouzit <madcoder@debian.org>
|
||||
* © 2008 Félix C. Morency <felix.morency@gmail.com>
|
||||
* © 2008 Michael Gehring <mg@ebfe.org>
|
||||
* © 2008 Hans Ulrich Niedermann <hun@n-dimensional.de>
|
||||
* © 2007 Aldo Cortesi <aldo@nullcube.com>
|
||||
|
||||
## License:
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
## Originally based on dwm code:
|
||||
|
||||
MIT/X Consortium License
|
||||
|
||||
* © 2006-2007 Anselm R. Garbe <garbeam@gmail.com>
|
||||
* © 2006-2007 Sander van Dijk <a.h.vandijk@gmail.com>
|
||||
* © 2006-2007 Jukka Salmi <jukka@salmi.ch>
|
||||
* © 2007 Premysl Hruby <dfenze@gmail.com>
|
||||
* © 2007 Szabolcs Nagy <nszabolcs@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
|
@ -0,0 +1,60 @@
|
|||
# Readme
|
||||
|
||||
## About awesome
|
||||
|
||||
awesome is a highly configurable, next generation framework window manager for X.
|
||||
|
||||
## Building and installation
|
||||
|
||||
After extracting the dist tarball, run:
|
||||
|
||||
make
|
||||
|
||||
This will create a build directory, run cmake in it and build awesome.
|
||||
|
||||
After building is finished, you can install:
|
||||
|
||||
make install # you might need root permissions
|
||||
|
||||
## Running awesome
|
||||
|
||||
You can directly select awesome from your display manager. If not, you can
|
||||
add the following line to your .xinitrc to start awesome using startx
|
||||
or to `.xsession` to start awesome using your display manager:
|
||||
|
||||
exec awesome
|
||||
|
||||
In order to connect awesome to a specific display, make sure that
|
||||
the `DISPLAY` environment variable is set correctly, e.g.:
|
||||
|
||||
DISPLAY=foo.bar:1 exec awesome
|
||||
|
||||
(This will start awesome on display `:1` of the host foo.bar.)
|
||||
|
||||
## Configuration
|
||||
|
||||
The configuration of awesome is done by creating a
|
||||
`$XDG_CONFIG_HOME/awesome/rc.lua` file.
|
||||
|
||||
An example configuration named `awesomerc.lua.in` is provided in the source.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
In most systems any message printed by awesome (including warnings and errors)
|
||||
are written to `$HOME/.xsession-errors`.
|
||||
|
||||
If awesome does not start or the configuration file is not producing the
|
||||
desired results the user should examine this file to gain insight into the
|
||||
problem.
|
||||
|
||||
## Reporting issues
|
||||
|
||||
Please report any issues you may find on [our bugtracker](https://github.com/awesomeWM/awesome/issues).
|
||||
You can submit pull requests on the [github repository](https://github.com/awesomeWM/awesome).
|
||||
Please read the @{02-contributing.md} guide for any coding, documentation or patch guidelines.
|
||||
|
||||
## License
|
||||
|
||||
The project is licensed under GNU General Publice License v2 or later.
|
||||
You can read it online at ([v2](http://www.gnu.org/licenses/gpl-2.0.html)
|
||||
or [v3](http://www.gnu.org/licenses/gpl.html)).
|
|
@ -0,0 +1,114 @@
|
|||
# Contributing
|
||||
|
||||
## Bugs
|
||||
|
||||
Please look at `https://github.com/awesomeWM/awesome/issues`.
|
||||
|
||||
## Style
|
||||
|
||||
If you intend to patch and contribute to awesome, please respect the
|
||||
following guidelines.
|
||||
|
||||
Imitate the existing code style. For concrete rules:
|
||||
|
||||
- Use 4 spaces indentation, do not use tabulator characters;
|
||||
|
||||
- Place braces alone on new lines, and do not place braces for single
|
||||
line statement where it is not needed, i.e. no:
|
||||
|
||||
if(bla) {
|
||||
x = 1;
|
||||
}
|
||||
|
||||
- Do not put a space after if, for, while or function call statements;
|
||||
|
||||
- The preferred line length is 80 characters;
|
||||
|
||||
- Use `/* */` for comments;
|
||||
|
||||
- Use the API: there's a list of `a_*()` functions you should use instead
|
||||
of the standard libc ones. There is also a common API for linked lists,
|
||||
tabulars, etc.;
|
||||
|
||||
- Be *clear* in what you do;
|
||||
|
||||
- Prefix your function name with the module they are enhancing,
|
||||
i.e. if you add a function to manipulate a tag prefix it with `tag_`;
|
||||
|
||||
- Write documentation for any new functions, options, whatever.
|
||||
|
||||
A vim modeline is set in each file to respect this.
|
||||
|
||||
### Documentation of lua files
|
||||
|
||||
For documentation purposes LDoc---see
|
||||
[here](https://stevedonovan.github.io/ldoc/manual/doc.md.html) for its
|
||||
documentation---is used. Comments that shall be parsed by LDoc have the
|
||||
following format:
|
||||
|
||||
--- summary.
|
||||
-- Description; this can extend over
|
||||
-- several lines
|
||||
|
||||
-----------------
|
||||
-- This will also do.
|
||||
|
||||
--[[--
|
||||
Summary. A description
|
||||
...;
|
||||
]]
|
||||
|
||||
One can use the full power of
|
||||
[Markdown](http://daringfireball.net/projects/markdown) with the extensions of
|
||||
[Discount](http://www.pell.portland.or.us/~orc/Code/discount/) for mark-up in
|
||||
the comments.
|
||||
|
||||
Every module and class should have a short description at its beginning which
|
||||
should include `@author author`, `@copyright year author`,
|
||||
`@release @AWESOME_VERSION@` and `@module module-name` or `@classmod class-name`.
|
||||
Parameters of functions should be documented by `@param parameter description`,
|
||||
return values via `@return description` or `@treturn type description`. For a
|
||||
more comprehensive description of the available tags see the [LDoc
|
||||
documentation](https://stevedonovan.github.io/ldoc/manual/doc.md.html).
|
||||
|
||||
In addition to the regular tags provided by LDoc there are also some aliases
|
||||
for tags defined in `docs/config.ld`.
|
||||
|
||||
## Patches
|
||||
|
||||
If you plan to submit patches, you should follow the following guidelines.
|
||||
|
||||
### Commits
|
||||
|
||||
- make commits of logical units;
|
||||
- do not modify piece of code not related to your commit;
|
||||
- do not try to fix style of code you are not writing,
|
||||
it's just adding noise for no gain;
|
||||
- check for unnecessary whitespace with `git diff --check` before committing;
|
||||
- do not check in commented out code or unneeded files;
|
||||
- provide a meaningful commit message;
|
||||
- the first line of the commit message should be a short;
|
||||
description and should skip the full stop;
|
||||
- if you want your work included, add a
|
||||
`Signed-off-by: Your Name <you@example.com>` line to the
|
||||
commit message (or just use the option `-s` when committing);
|
||||
- make sure that you have tests for the bug you are fixing;
|
||||
- if possible, add a unit test to the test suite under spec/.
|
||||
|
||||
### Patches
|
||||
|
||||
Submitting patches via pull requests on the Github project is the preferred
|
||||
method.
|
||||
|
||||
#### Pull request
|
||||
- create a [pull request](https://github.com/awesomeWM/awesome/pulls)
|
||||
|
||||
#### git-send-email
|
||||
- use `git format-patch -M` to create the patch;
|
||||
- do *not* PGP sign your patch;
|
||||
- be *careful* doing cut & paste into your mailer, not to corrupt whitespaces;
|
||||
- if you change, add or remove the user API, the associated documentation
|
||||
should be updated as well;
|
||||
- send the patch to the list (`awesome-devel@naquadah.org`) if (and only if)
|
||||
the patch is ready for inclusion. If you use git-send-email(1), please *test*
|
||||
it first by sending email to yourself.
|
|
@ -1,74 +1,77 @@
|
|||
--- awesome core API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("awesome")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awesome
|
||||
|
||||
--- awesome global table.
|
||||
--
|
||||
-- @field version The version of awesome.
|
||||
-- @field release The release name of awesome.
|
||||
-- @field conffile The configuration file which has been loaded.
|
||||
-- @field startup True if we are still in startup, false otherwise.
|
||||
-- @field startup_errors Error message for errors that occured during startup.
|
||||
-- @field composite_manager_running True if a composite manager is running.
|
||||
-- @class table
|
||||
-- @name awesome
|
||||
-- @table awesome
|
||||
|
||||
--- Quit awesome.
|
||||
-- @name quit
|
||||
-- @class function
|
||||
--
|
||||
-- @function quit
|
||||
|
||||
--- Execute another application, probably a window manager, to replace
|
||||
-- awesome.
|
||||
--
|
||||
-- @param cmd The command line to execute.
|
||||
-- @name exec
|
||||
-- @class function
|
||||
-- @function exec
|
||||
|
||||
--- Restart awesome.
|
||||
--
|
||||
-- @name restart
|
||||
-- @class function
|
||||
|
||||
--- Spawn a program.
|
||||
--
|
||||
-- @param cmd The command to launch. Either a string or a table of strings.
|
||||
-- @param use_sn Use startup-notification, true or false, default to true.
|
||||
-- @return Process ID if everything is OK, or an error string if an error occured.
|
||||
|
||||
--- Load an image
|
||||
--
|
||||
-- @param name The file name
|
||||
-- @return A cairo image surface as light user datum
|
||||
-- @name load_image
|
||||
-- @class function
|
||||
-- @function load_image
|
||||
|
||||
--- Register a new xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @param type One of "string", "number" or "boolean"
|
||||
-- @name register_xproperty
|
||||
-- @class function
|
||||
-- @function register_xproperty
|
||||
|
||||
--- Change a xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @param value The new value for the property
|
||||
-- @name set_xproperty
|
||||
-- @class function
|
||||
-- @function set_xproperty
|
||||
|
||||
--- Get the value of a xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @name get_xproperty
|
||||
-- @class function
|
||||
-- @function get_xproperty
|
||||
|
||||
--- Add a global signal.
|
||||
--
|
||||
-- @param name A string with the event name.
|
||||
-- @param func The function to call.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a global signal.
|
||||
--
|
||||
-- @param name A string with the event name.
|
||||
-- @param func The function to call.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a global signal.
|
||||
--
|
||||
-- @param name A string with the event name.
|
||||
-- @param ... Signal arguments.
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
-- @function emit_signal
|
|
@ -0,0 +1,31 @@
|
|||
--- awesome button API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod button
|
||||
|
||||
--- Button object.
|
||||
--
|
||||
-- @tfield int button The mouse button number, or 0 for any button.
|
||||
-- @tfield table modifiers The modifier key table that should be pressed while the
|
||||
-- button is pressed.
|
||||
-- @table button
|
||||
|
||||
--- Add a signal.
|
||||
-- @tparam string name A signal name.
|
||||
-- @tparam func func A function to call when the signal is emitted.
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal.
|
||||
-- @tparam string name A signal name.
|
||||
-- @tparam func func A function to remove.
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal.
|
||||
-- @tparam string name A signal name.
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
||||
|
||||
--- Get the number of instances.
|
||||
-- @treturn int The number of button objects alive.
|
||||
-- @function instances
|
|
@ -1,9 +1,11 @@
|
|||
--- awesome client API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("client")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod client
|
||||
|
||||
--- Client object.
|
||||
--
|
||||
-- @field window The X window id.
|
||||
-- @field name The client title.
|
||||
-- @field skip_taskbar True if the client does not want to be in taskbar.
|
||||
|
@ -17,9 +19,9 @@ module("client")
|
|||
-- @field icon The client icon.
|
||||
-- @field screen Client screen.
|
||||
-- @field hidden Define if the client must be hidden, i.e. never mapped,
|
||||
-- invisible in taskbar.
|
||||
-- invisible in taskbar.
|
||||
-- @field minimized Define it the client must be iconify, i.e. only visible in
|
||||
-- taskbar.
|
||||
-- taskbar.
|
||||
-- @field size_hints_honor Honor size hints, i.e. respect size ratio.
|
||||
-- @field border_width The client border width.
|
||||
-- @field border_color The client border color.
|
||||
|
@ -38,7 +40,7 @@ module("client")
|
|||
-- @field group_window Window identification unique to a group of windows.
|
||||
-- @field leader_window Identification unique to windows spawned by the same command.
|
||||
-- @field size_hints A table with size hints of the client: user_position,
|
||||
-- user_size, program_position, program_size, etc.
|
||||
-- user_size, program_position, program_size, etc.
|
||||
-- @field sticky Set the client sticky, i.e. available on all tags.
|
||||
-- @field modal Indicate if the client is modal.
|
||||
-- @field focusable True if the client can receive the input focus.
|
||||
|
@ -48,25 +50,24 @@ module("client")
|
|||
-- @field shape_client_clip The client's clip shape as set by the program as a (native) cairo surface.
|
||||
-- @field startup_id The FreeDesktop StartId.
|
||||
-- @field valid If the client that this object refers to is still managed by awesome.
|
||||
-- @class table
|
||||
-- @name client
|
||||
-- @table client
|
||||
|
||||
--- Get all clients into a table.
|
||||
-- @param screen An optional screen number.
|
||||
--
|
||||
-- @param[opt] screen A screen number.
|
||||
-- @return A table with all clients.
|
||||
-- @name get
|
||||
-- @class function
|
||||
-- @function get
|
||||
|
||||
--- Check if a client is visible on its screen.
|
||||
--
|
||||
-- @return A boolean value, true if the client is visible, false otherwise.
|
||||
-- @name isvisible
|
||||
-- @class function
|
||||
-- @function isvisible
|
||||
|
||||
--- Return client geometry.
|
||||
--
|
||||
-- @param arg1 A table with new coordinates, or none.
|
||||
-- @return A table with client coordinates.
|
||||
-- @name geometry
|
||||
-- @class function
|
||||
-- @function geometry
|
||||
|
||||
--- Apply size hints to a size.
|
||||
-- @param width Desired width of client
|
||||
|
@ -77,80 +78,79 @@ module("client")
|
|||
-- @class function
|
||||
|
||||
--- Return client struts (reserved space at the edge of the screen).
|
||||
--
|
||||
-- @param struts A table with new strut values, or none.
|
||||
-- @return A table with strut values.
|
||||
-- @name struts
|
||||
-- @class function
|
||||
-- @function struts
|
||||
|
||||
--- Get or set mouse buttons bindings for a client.
|
||||
--
|
||||
-- @param buttons_table An array of mouse button bindings objects, or nothing.
|
||||
-- @return A table with all buttons.
|
||||
-- @name buttons
|
||||
-- @class function
|
||||
-- @function buttons
|
||||
|
||||
--- Get or set keys bindings for a client.
|
||||
--
|
||||
-- @param keys_table An array of key bindings objects, or nothing.
|
||||
-- @return A table with all keys.
|
||||
-- @name keys
|
||||
-- @class function
|
||||
-- @function keys
|
||||
|
||||
--- Access or set the client tags.
|
||||
--
|
||||
-- @param tags_table A table with tags to set, or none to get the current tags table.
|
||||
-- @return A table with all tags.
|
||||
-- @name tags
|
||||
-- @class function
|
||||
-- @function tags
|
||||
|
||||
--- Kill a client.
|
||||
-- @name kill
|
||||
-- @class function
|
||||
--
|
||||
-- @function kill
|
||||
|
||||
--- Swap a client with another one in global client list.
|
||||
-- @client A client to swap with.
|
||||
-- @name swap
|
||||
-- @class function
|
||||
-- @function swap
|
||||
|
||||
--- Raise a client on top of others which are on the same layer.
|
||||
-- @name raise
|
||||
-- @class function
|
||||
--
|
||||
-- @function raise
|
||||
|
||||
--- Lower a client on bottom of others which are on the same layer.
|
||||
-- @name lower
|
||||
-- @class function
|
||||
--
|
||||
-- @function lower
|
||||
|
||||
--- Stop managing a client.
|
||||
-- @name unmanage
|
||||
-- @class function
|
||||
--
|
||||
-- @function unmanage
|
||||
|
||||
--- Change a xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @param value The new value for the property
|
||||
-- @name set_xproperty
|
||||
-- @class function
|
||||
-- @function set_xproperty
|
||||
|
||||
--- Get the value of a xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @name get_xproperty
|
||||
-- @class function
|
||||
-- @function get_xproperty
|
||||
|
||||
--- Add a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to call when the signal is emitted.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to remove.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param ... Various arguments, optional.
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
||||
|
||||
--- Get the number of instances.
|
||||
--
|
||||
-- @return The number of client objects alive.
|
||||
-- @name instances
|
||||
-- @class function
|
||||
-- @function instances
|
|
@ -1,46 +1,47 @@
|
|||
--- awesome D-Bus API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("dbus")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module dbus
|
||||
|
||||
--- Register a D-Bus name to receive message from.
|
||||
--
|
||||
-- @param bus A string indicating if we are using system or session bus.
|
||||
-- @param name A string with the name of the D-Bus name to register.
|
||||
-- @return True if everything worked fine, false otherwise.
|
||||
-- @name request_name
|
||||
-- @class function
|
||||
-- @function request_name
|
||||
|
||||
--- Release a D-Bus name.
|
||||
--
|
||||
-- @param bus A string indicating if we are using system or session bus.
|
||||
-- @param name A string with the name of the D-Bus name to unregister.
|
||||
-- @return True if everything worked fine, false otherwise.
|
||||
-- @name release_name
|
||||
-- @class function
|
||||
-- @function release_name
|
||||
|
||||
--- Add a match rule to match messages going through the message bus.
|
||||
--
|
||||
-- @param bus A string indicating if we are using system or session bus.
|
||||
-- @param name A string with the name of the match rule.
|
||||
-- @name add_match
|
||||
-- @class function
|
||||
-- @function add_match
|
||||
|
||||
--- Remove a previously added match rule "by value"
|
||||
-- (the most recently-added identical rule gets removed).
|
||||
--
|
||||
-- @param bus A string indicating if we are using system or session bus.
|
||||
-- @param name A string with the name of the match rule.
|
||||
-- @name remove_match
|
||||
-- @class function
|
||||
-- @function remove_match
|
||||
|
||||
--- Add a signal receiver on the D-Bus.
|
||||
--
|
||||
-- @param interface A string with the interface name.
|
||||
-- @param func The function to call.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal receiver on the D-Bus.
|
||||
--
|
||||
-- @param interface A string with the interface name.
|
||||
-- @param func The function to call.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
-- Emit a signal on the D-Bus.
|
||||
-- @param bus A string indicating if we are using system or session bus.
|
||||
|
@ -52,6 +53,4 @@ module("dbus")
|
|||
-- @param type_2nd_arg type of 2nd argument
|
||||
-- @param value_2nd_arg value of 2nd argument
|
||||
-- ... etc
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
--
|
||||
-- @function emit_signal
|
|
@ -1,42 +1,43 @@
|
|||
--- awesome drawable API
|
||||
-- @author Uli Schlachter <psychon@znc.in>
|
||||
-- @copyright 2012 Uli Schlachter
|
||||
module("drawable")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod drawable
|
||||
|
||||
--- Drawable object.
|
||||
--
|
||||
-- @field surface The drawable's cairo surface.
|
||||
-- @name drawable
|
||||
-- @class table
|
||||
-- @function drawable
|
||||
|
||||
--- Get drawable geometry. The geometry consists of x, y, width and height.
|
||||
--
|
||||
-- @return A table with drawable coordinates and geometry.
|
||||
-- @name geometry
|
||||
-- @class function
|
||||
-- @function geometry
|
||||
|
||||
--- Refresh the drawable. When you are drawing to the surface, you have
|
||||
-- call this function when you are done to make the result visible.
|
||||
-- @name refresh
|
||||
-- @class function
|
||||
--
|
||||
-- @function refresh
|
||||
|
||||
--- Add a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to call when the signal is emitted.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to remove.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param ... Various arguments, optional.
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
||||
|
||||
--- Get the number of instances.
|
||||
--
|
||||
-- @return The number of drawable objects alive.
|
||||
-- @name instances
|
||||
-- @class function
|
||||
-- @function instances
|
|
@ -1,9 +1,11 @@
|
|||
--- awesome drawin API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("drawin")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod drawin
|
||||
|
||||
--- Drawin object.
|
||||
--
|
||||
-- @field border_width Border width.
|
||||
-- @field border_color Border color.
|
||||
-- @field ontop On top of other windows.
|
||||
|
@ -19,57 +21,56 @@ module("drawin")
|
|||
-- @field window The X window id.
|
||||
-- @field shape_bounding The drawin's bounding shape as a (native) cairo surface.
|
||||
-- @field shape_clip The drawin's clip shape as a (native) cairo surface.
|
||||
-- @class table
|
||||
-- @name drawin
|
||||
-- @table drawin
|
||||
|
||||
--- Get or set mouse buttons bindings to a drawin.
|
||||
--
|
||||
-- @param buttons_table A table of buttons objects, or nothing.
|
||||
-- @name buttons
|
||||
-- @class function
|
||||
-- @function buttons
|
||||
|
||||
--- Get or set drawin struts.
|
||||
--
|
||||
-- @param strut A table with new strut, or nothing
|
||||
-- @return The drawin strut in a table.
|
||||
-- @name struts
|
||||
-- @class function
|
||||
-- @function struts
|
||||
|
||||
--- Get or set drawin geometry. That's the same as accessing or setting the x, y, width or height
|
||||
-- properties of a drawin.
|
||||
--
|
||||
-- @param A table with coordinates to modify.
|
||||
-- @return A table with drawin coordinates and geometry.
|
||||
-- @name geometry
|
||||
-- @class function
|
||||
-- @function geometry
|
||||
|
||||
--- Change a xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @param value The new value for the property
|
||||
-- @name set_xproperty
|
||||
-- @class function
|
||||
-- @function set_xproperty
|
||||
|
||||
--- Get the value of a xproperty.
|
||||
--
|
||||
-- @param name The name of the X11 property
|
||||
-- @name get_xproperty
|
||||
-- @class function
|
||||
-- @function get_xproperty
|
||||
|
||||
--- Add a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to call when the signal is emitted.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to remove.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param ... Various arguments, optional.
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
||||
|
||||
--- Get the number of instances.
|
||||
--
|
||||
-- @return The number of drawin objects alive.
|
||||
-- @name instances
|
||||
-- @class function
|
||||
-- @function instances
|
|
@ -1,37 +1,38 @@
|
|||
--- awesome key API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("key")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod key
|
||||
|
||||
--- Key object.
|
||||
--
|
||||
-- @field key The key to press to triggers an event.
|
||||
-- @field keysym Same as key, but return the name of the key symbol. It can
|
||||
-- be identical to key, but for characters like '.' it will return 'period'.
|
||||
-- be identical to key, but for characters like '.' it will return 'period'.
|
||||
-- @field modifiers The modifier key that should be pressed while the key is
|
||||
-- pressed. An array with all the modifiers. Valid modifiers are: Any, Mod1,
|
||||
-- Mod2, Mod3, Mod4, Mod5, Shift, Lock and Control.
|
||||
-- @class table
|
||||
-- @name key
|
||||
-- pressed. An array with all the modifiers. Valid modifiers are: Any, Mod1,
|
||||
-- Mod2, Mod3, Mod4, Mod5, Shift, Lock and Control.
|
||||
-- @table key
|
||||
|
||||
--- Add a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to call when the signal is emitted.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to remove.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param ... Various arguments, optional.
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
||||
|
||||
--- Get the number of instances.
|
||||
--
|
||||
-- @return The number of key objects alive.
|
||||
-- @name instances
|
||||
-- @class function
|
||||
-- @function instances
|
|
@ -0,0 +1,39 @@
|
|||
--- awesome keygrabber API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module keygrabber
|
||||
|
||||
---
|
||||
-- Grab keyboard input and read pressed keys, calling a callback function at
|
||||
-- each keypress, until `keygrabber.stop` is called.
|
||||
-- The callback function receives three arguments:
|
||||
--
|
||||
-- * a table containing modifiers keys
|
||||
-- * a string with the pressed key
|
||||
-- * a string with either "press" or "release" to indicate the event type.
|
||||
--
|
||||
-- @param callback A callback function as described above.
|
||||
-- @function run
|
||||
-- @usage The following function can be bound to a key, and will be used to
|
||||
-- resize a client using keyboard.
|
||||
--
|
||||
-- function resize(c)
|
||||
-- keygrabber.run(function(mod, key, event)
|
||||
-- if event == "release" then return end
|
||||
--
|
||||
-- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c)
|
||||
-- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c)
|
||||
-- elseif key == 'Right' then awful.client.moveresize(0, 0, 5, 0, c)
|
||||
-- elseif key == 'Left' then awful.client.moveresize(0, 0, -5, 0, c)
|
||||
-- else keygrabber.stop()
|
||||
-- end
|
||||
-- end)
|
||||
-- end
|
||||
|
||||
--- Stop grabbing the keyboard.
|
||||
-- @function stop
|
||||
|
||||
--- Check if the keygrabber is running.
|
||||
-- @return A boolean value, true if running, false otherwise.
|
||||
-- @function isrunning
|
|
@ -1,9 +1,11 @@
|
|||
--- awesome mouse API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("mouse")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module mouse
|
||||
|
||||
--- Mouse library.
|
||||
--
|
||||
-- @field screen Mouse screen number.
|
||||
-- @table mouse
|
||||
|
|
@ -1,23 +1,24 @@
|
|||
--- awesome mousegrabber API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("mousegrabber")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module mousegrabber
|
||||
|
||||
--- Grab the mouse pointer and list motions, calling callback function at each
|
||||
-- motion. The callback function must return a boolean value: true to
|
||||
-- continue grabbing, false to stop.
|
||||
-- The function is called with one argument:
|
||||
-- a table containing modifiers pointer coordinates.
|
||||
--
|
||||
-- @param func A callback function as described above.
|
||||
-- @param cursor The name of a X cursor to use while grabbing.
|
||||
-- @name run
|
||||
-- @class function
|
||||
-- @function run
|
||||
|
||||
--- Stop grabbing the mouse pointer.
|
||||
-- @name stop
|
||||
-- @class function
|
||||
--
|
||||
-- @function stop
|
||||
|
||||
--- Check if the mousegrabber is running.
|
||||
--
|
||||
-- @return A boolean value, true if running, false otherwise.
|
||||
-- @name isrunning
|
||||
-- @class function
|
||||
-- @function isrunning
|
|
@ -1,50 +1,51 @@
|
|||
--- awesome root window API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("root")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module root
|
||||
|
||||
--- Get or set global mouse bindings.
|
||||
-- This binding will be available when you'll click on root window.
|
||||
--
|
||||
-- @param button_table An array of mouse button bindings objects, or nothing.
|
||||
-- @return The array of mouse button bindings objects.
|
||||
-- @name buttons
|
||||
-- @class function
|
||||
-- @function buttons
|
||||
|
||||
--- Get or set global key bindings.
|
||||
-- These binding will be available when you press keys on the root window.
|
||||
-- @param keys_array An array of key binding objects, or nothing.
|
||||
-- @tparam table|nil keys_array An array of key binding objects, or nothing.
|
||||
-- @return The array of key bindings objects of this client.
|
||||
-- @name keys
|
||||
-- @class function
|
||||
-- @function keys
|
||||
|
||||
--- Set the root cursor.
|
||||
--
|
||||
-- @param cursor_name A X cursor name.
|
||||
-- @name cursor
|
||||
-- @class function
|
||||
-- @function cursor
|
||||
|
||||
--- Send fake events. Usually the current focused client will get it.
|
||||
--
|
||||
-- @param event_type The event type: key_press, key_release, button_press, button_release
|
||||
-- or motion_notify.
|
||||
-- or motion_notify.
|
||||
-- @param detail The detail: in case of a key event, this is the keycode to send, in
|
||||
-- case of a button event this is the number of the button. In case of a motion
|
||||
-- event, this is a boolean value which if true make the coordinates relatives.
|
||||
-- case of a button event this is the number of the button. In case of a
|
||||
-- motion event, this is a boolean value which if true make the coordinates
|
||||
-- relatives.
|
||||
-- @param x In case of a motion event, this is the X coordinate.
|
||||
-- @param y In case of a motion event, this is the Y coordinate.
|
||||
-- @name fake_input
|
||||
-- @class function
|
||||
-- @function fake_input
|
||||
|
||||
--- Get the drawins attached to a screen.
|
||||
--
|
||||
-- @return A table with all drawins.
|
||||
-- @name drawins
|
||||
-- @class function
|
||||
-- @function drawins
|
||||
|
||||
--- Get the wallpaper as a cairo surface or set it as a cairo pattern.
|
||||
--
|
||||
-- @param pattern A cairo pattern as light userdata
|
||||
-- @return A cairo surface or nothing.
|
||||
-- @name wallpaper
|
||||
-- @class function
|
||||
-- @function wallpaper
|
||||
|
||||
--- Get the attached tags.
|
||||
--
|
||||
-- @return A table with all tags.
|
||||
-- @name tags
|
||||
-- @class function
|
||||
-- @function tags
|
|
@ -0,0 +1,40 @@
|
|||
--- awesome screen API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod screen
|
||||
|
||||
--- Screen is a table where indexes are screen numbers. You can use `screen[1]`
|
||||
-- to get access to the first screen, etc. Alternatively, if RANDR information
|
||||
-- is available, you can use output names for finding screen objects.
|
||||
-- Each screen has a set of properties.
|
||||
--
|
||||
-- @tfield table geometry The screen coordinates. Immutable.
|
||||
-- @tfield table workarea The screen workarea.
|
||||
-- @tfield int index The screen number.
|
||||
-- @tfield table outputs If RANDR information is available, a list of outputs
|
||||
-- for this screen and their size in mm.
|
||||
-- @table screen
|
||||
|
||||
--- Get the number of screens.
|
||||
--
|
||||
-- @return The screen count, at least 1.
|
||||
-- @function count
|
||||
|
||||
--- Add a signal to a screen.
|
||||
--
|
||||
-- @string name A signal name.
|
||||
-- @func func A function to call when the signal is emitted.
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal to a screen.
|
||||
--
|
||||
-- @string name A signal name.
|
||||
-- @func func A function to remove
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal to a screen.
|
||||
--
|
||||
-- @string name A signal name.
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
|
@ -1,9 +1,10 @@
|
|||
--- awesome selection (clipboard) API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("selection")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module selection
|
||||
|
||||
--- Get the selection (clipboard) content.
|
||||
--
|
||||
-- @return A string with the selection (clipboard) content.
|
||||
-- @name selection
|
||||
-- @class function
|
||||
-- @function selection
|
|
@ -1,40 +1,41 @@
|
|||
--- awesome tag API
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
module("tag")
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod tag
|
||||
|
||||
--- Tag object.
|
||||
--
|
||||
-- @field name Tag name.
|
||||
-- @field selected True if the tag is selected to be viewed.
|
||||
-- @field activated True if the tag is active and can be used.
|
||||
-- @class table
|
||||
-- @name tag
|
||||
-- @table tag
|
||||
|
||||
--- Get or set the clients attached to this tag.
|
||||
--
|
||||
-- @param clients_table None or a table of clients to set as being tagged with this tag.
|
||||
-- @return A table with the clients attached to this tags.
|
||||
-- @name clients
|
||||
-- @class function
|
||||
-- @function clients
|
||||
|
||||
--- Add a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to call when the signal is emitted.
|
||||
-- @name connect_signal
|
||||
-- @class function
|
||||
-- @function connect_signal
|
||||
|
||||
--- Remove a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param func A function to remove.
|
||||
-- @name disconnect_signal
|
||||
-- @class function
|
||||
-- @function disconnect_signal
|
||||
|
||||
--- Emit a signal.
|
||||
--
|
||||
-- @param name A signal name.
|
||||
-- @param ... Various arguments, optional.
|
||||
-- @name emit_signal
|
||||
-- @class function
|
||||
-- @param[opt] ... Various arguments.
|
||||
-- @function emit_signal
|
||||
|
||||
--- Get the number of instances.
|
||||
--
|
||||
-- @return The number of tag objects alive.
|
||||
-- @name instances
|
||||
-- @class function
|
||||
-- @function instances
|
|
@ -0,0 +1,62 @@
|
|||
-- Configuration file for ldoc
|
||||
|
||||
project='awesome'
|
||||
title='awesome API documentation'
|
||||
description='highly configurable X window manager'
|
||||
|
||||
-- More on it: https://github.com/stevedonovan/LDoc/blob/master/doc/doc.md#markdown-support
|
||||
format='discount'
|
||||
dir='../doc'
|
||||
|
||||
-- Make the docs prettier
|
||||
pretty='lua'
|
||||
style="!pale"
|
||||
backtick_references=true
|
||||
merge=true
|
||||
use_markdown_titles = true
|
||||
wrap=true
|
||||
topics={
|
||||
'00-authors.md',
|
||||
'01-readme.md',
|
||||
'02-contributing.md',
|
||||
}
|
||||
|
||||
-- Setup @client to be an alias for "@tparam client.client"
|
||||
tparam_alias('client', 'client.client')
|
||||
tparam_alias('tag', 'tag')
|
||||
-- Should be default, but is not. Sets up "@tab" => "@tparam table".
|
||||
tparam_alias('tab', 'table')
|
||||
|
||||
-- More fitting section names
|
||||
kind_names={topic='Documentation',module='Libraries'}
|
||||
|
||||
-- Sort modules alphabetically
|
||||
sort_modules=true
|
||||
|
||||
file = {
|
||||
-- LUA libraries
|
||||
'capi/',
|
||||
'../lib/',
|
||||
exclude = {
|
||||
-- exclude these modules, as they do not contain any written
|
||||
-- documentation
|
||||
'../lib/awful/autofocus.lua',
|
||||
'../lib/awful/dbus.lua',
|
||||
'../lib/awful/ewmh.lua',
|
||||
'../lib/awful/init.lua',
|
||||
'../lib/awful/remote.lua',
|
||||
'../lib/awful/startup_notification.lua',
|
||||
'../lib/gears/init.lua',
|
||||
'../lib/wibox/layout/init.lua',
|
||||
'../lib/wibox/widget/init.lua',
|
||||
'../lib/wibox/widget/systray.lua',
|
||||
|
||||
-- Ignore some parts of the widget library
|
||||
'../lib/awful/widget/init.lua',
|
||||
|
||||
-- exclude layout, but we need an extra bit of documentation elsewhere.
|
||||
'../lib/awful/layout/suit/'
|
||||
}
|
||||
}
|
||||
|
||||
-- vim: filetype=lua
|
|
@ -1,7 +1,13 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Autofocus functions.
|
||||
--
|
||||
-- When loaded, this module makes sure that there's always a client that will
|
||||
-- have focus on events such as tag switching, client unmanaging, etc.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.autofocus
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local client = client
|
||||
|
@ -10,11 +16,8 @@ local aclient = require("awful.client")
|
|||
local atag = require("awful.tag")
|
||||
local timer = require("gears.timer")
|
||||
|
||||
--- When loaded, this module makes sure that there's always a client that will have focus
|
||||
-- on events such as tag switching, client unmanaging, etc.
|
||||
-- awful.autofocus
|
||||
|
||||
-- Give focus when clients appear/disappear.
|
||||
--- Give focus when clients appear/disappear.
|
||||
--
|
||||
-- @param obj An object that should have a .screen property.
|
||||
local function check_focus(obj)
|
||||
-- When no visible client has the focus...
|
||||
|
@ -26,13 +29,14 @@ local function check_focus(obj)
|
|||
end
|
||||
end
|
||||
|
||||
-- Check client focus (delayed).
|
||||
--- Check client focus (delayed).
|
||||
-- @param obj An object that should have a .screen property.
|
||||
local function check_focus_delayed(obj)
|
||||
timer.delayed_call(check_focus, {screen = obj.screen})
|
||||
end
|
||||
|
||||
-- Give focus on tag selection change.
|
||||
--- Give focus on tag selection change.
|
||||
--
|
||||
-- @param tag A tag object
|
||||
local function check_focus_tag(t)
|
||||
local s = atag.getscreen(t)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Create easily new buttons objects ignoring certain modifiers.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.button
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -10,28 +13,30 @@ local ipairs = ipairs
|
|||
local capi = { button = button }
|
||||
local util = require("awful.util")
|
||||
|
||||
--- Create easily new buttons objects ignoring certain modifiers.
|
||||
-- awful.button
|
||||
local button = { mt = {} }
|
||||
|
||||
--- Modifiers to ignore.
|
||||
-- By default this is initialized as { "Lock", "Mod2" }
|
||||
-- so the Caps Lock or Num Lock modifier are not taking into account by awesome
|
||||
--
|
||||
-- By default this is initialized as `{ "Lock", "Mod2" }`
|
||||
-- so the `Caps Lock` or `Num Lock` modifier are not taking into account by awesome
|
||||
-- when pressing keys.
|
||||
-- @name ignore_modifiers
|
||||
-- @class table
|
||||
--
|
||||
-- @table ignore_modifiers
|
||||
local ignore_modifiers = { "Lock", "Mod2" }
|
||||
|
||||
--- Create a new button to use as binding.
|
||||
--
|
||||
-- This function is useful to create several buttons from one, because it will use
|
||||
-- the ignore_modifier variable to create more button with or without the ignored
|
||||
-- modifiers activated.
|
||||
--
|
||||
-- For example if you want to ignore CapsLock in your buttonbinding (which is
|
||||
-- ignored by default by this function), creating button binding with this function
|
||||
-- will return 2 button objects: one with CapsLock on, and the other one with
|
||||
-- CapsLock off.
|
||||
--
|
||||
-- @see button
|
||||
-- @return A table with one or several button objects.
|
||||
-- @treturn table A table with one or several button objects.
|
||||
function button.new(mod, _button, press, release)
|
||||
local ret = {}
|
||||
local subsets = util.subsets(ignore_modifiers)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Useful client manipulation functions.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.client
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -24,11 +27,8 @@ local capi =
|
|||
-- we use require("awful.screen") inside functions to prevent circular dependencies.
|
||||
local screen
|
||||
|
||||
--- Useful client manipulation functions.
|
||||
-- awful.client
|
||||
local client = {}
|
||||
|
||||
|
||||
-- Private data
|
||||
client.data = {}
|
||||
client.data.focus = {}
|
||||
|
@ -48,11 +48,11 @@ client.dockable = {}
|
|||
client.property = {}
|
||||
client.shape = require("awful.client.shape")
|
||||
|
||||
---
|
||||
-- Jump to the given client. Takes care of focussing the screen, the right tag,
|
||||
-- etc.
|
||||
-- @param c the client to jump to
|
||||
-- @param merge If true then merge tags when clients are not visible.
|
||||
--- Jump to the given client.
|
||||
-- Takes care of focussing the screen, the right tag, etc.
|
||||
--
|
||||
-- @client c the client to jump to
|
||||
-- @tparam bool merge If true then merge tags when clients are not visible.
|
||||
function client.jumpto(c, merge)
|
||||
local s = capi.client.focus and capi.client.focus.screen or capi.mouse.screen
|
||||
-- focus the screen
|
||||
|
@ -76,7 +76,8 @@ function client.jumpto(c, merge)
|
|||
end
|
||||
|
||||
--- Get the first client that got the urgent hint.
|
||||
-- @return The first urgent client.
|
||||
--
|
||||
-- @treturn client The first urgent client.
|
||||
function client.urgent.get()
|
||||
if #client.data.urgent > 0 then
|
||||
return client.data.urgent[1]
|
||||
|
@ -92,7 +93,8 @@ function client.urgent.get()
|
|||
end
|
||||
|
||||
--- Jump to the client that received the urgent hint first.
|
||||
-- @param merge If true then merge tags when clients are not visible.
|
||||
--
|
||||
-- @tparam bool merge If true then merge tags when clients are not visible.
|
||||
function client.urgent.jumpto(merge)
|
||||
local c = client.urgent.get()
|
||||
if c then
|
||||
|
@ -101,7 +103,8 @@ function client.urgent.jumpto(merge)
|
|||
end
|
||||
|
||||
--- Adds client to urgent stack.
|
||||
-- @param c The client object.
|
||||
--
|
||||
-- @client c The client object.
|
||||
-- @param prop The property which is updated.
|
||||
function client.urgent.add(c, prop)
|
||||
if type(c) == "client" and prop == "urgent" and c.urgent then
|
||||
|
@ -110,7 +113,8 @@ function client.urgent.add(c, prop)
|
|||
end
|
||||
|
||||
--- Remove client from urgent stack.
|
||||
-- @param c The client object.
|
||||
--
|
||||
-- @client c The client object.
|
||||
function client.urgent.delete(c)
|
||||
for k, cl in ipairs(client.data.urgent) do
|
||||
if c == cl then
|
||||
|
@ -121,7 +125,8 @@ function client.urgent.delete(c)
|
|||
end
|
||||
|
||||
--- Remove a client from the focus history
|
||||
-- @param c The client that must be removed.
|
||||
--
|
||||
-- @client c The client that must be removed.
|
||||
function client.focus.history.delete(c)
|
||||
for k, v in ipairs(client.data.focus) do
|
||||
if v == c then
|
||||
|
@ -134,7 +139,8 @@ end
|
|||
--- Filter out window that we do not want handled by focus.
|
||||
-- This usually means that desktop, dock and splash windows are
|
||||
-- not registered and cannot get focus.
|
||||
-- @param c A client.
|
||||
--
|
||||
-- @client c A client.
|
||||
-- @return The same client if it's ok, nil otherwise.
|
||||
function client.focus.filter(c)
|
||||
if c.type == "desktop"
|
||||
|
@ -147,7 +153,8 @@ function client.focus.filter(c)
|
|||
end
|
||||
|
||||
--- Update client focus history.
|
||||
-- @param c The client that has been focused.
|
||||
--
|
||||
-- @client c The client that has been focused.
|
||||
function client.focus.history.add(c)
|
||||
-- Remove the client if its in stack
|
||||
client.focus.history.delete(c)
|
||||
|
@ -156,9 +163,10 @@ function client.focus.history.add(c)
|
|||
end
|
||||
|
||||
--- Get the latest focused client for a screen in history.
|
||||
--
|
||||
-- @param screen The screen number to look for.
|
||||
-- @param idx The index: 0 will return first candidate,
|
||||
-- 1 will return second, etc.
|
||||
-- 1 will return second, etc.
|
||||
-- @return A client.
|
||||
function client.focus.history.get(screen, idx)
|
||||
-- When this counter is equal to idx, we return the client
|
||||
|
@ -203,6 +211,7 @@ function client.focus.history.previous()
|
|||
end
|
||||
|
||||
--- Get visible clients from a screen.
|
||||
--
|
||||
-- @param screen The screen number, or nil for all screens.
|
||||
-- @return A table with all visible clients.
|
||||
function client.visible(screen)
|
||||
|
@ -217,6 +226,7 @@ function client.visible(screen)
|
|||
end
|
||||
|
||||
--- Get visible and tiled clients
|
||||
--
|
||||
-- @param screen The screen number, or nil for all screens.
|
||||
-- @return A table with all visible and tiled clients.
|
||||
function client.tiled(screen)
|
||||
|
@ -234,10 +244,17 @@ function client.tiled(screen)
|
|||
return tclients
|
||||
end
|
||||
|
||||
--- Get a client by its relative index to the focused window.
|
||||
-- @param i The index. Use 1 to get next, -1 to get previous.
|
||||
-- @param c Optional client.
|
||||
--- Get a client by its relative index to another client.
|
||||
-- If no client is passed, the focused client will be used.
|
||||
--
|
||||
-- @tparam int i The index. Use 1 to get the next, -1 to get the previous.
|
||||
-- @client[opt] c The client.
|
||||
-- @return A client, or nil if no client is available.
|
||||
--
|
||||
-- @usage -- focus the next window in the index
|
||||
-- awful.client.next(1)
|
||||
-- -- focus the previous
|
||||
-- awful.client.next(-1)
|
||||
function client.next(i, c)
|
||||
-- Get currently focused client
|
||||
local sel = c or capi.client.focus
|
||||
|
@ -263,8 +280,10 @@ function client.next(i, c)
|
|||
end
|
||||
|
||||
--- Focus a client by the given direction.
|
||||
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
||||
-- @param c Optional client.
|
||||
--
|
||||
-- @tparam string dir The direction, can be either
|
||||
-- `"up"`, `"down"`, `"left"` or `"right"`.
|
||||
-- @client[opt] c The client.
|
||||
function client.focus.bydirection(dir, c)
|
||||
local sel = c or capi.client.focus
|
||||
if sel then
|
||||
|
@ -284,8 +303,9 @@ function client.focus.bydirection(dir, c)
|
|||
end
|
||||
|
||||
--- Focus a client by the given direction. Moves across screens.
|
||||
--
|
||||
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
||||
-- @param c Optional client.
|
||||
-- @client[opt] c The client.
|
||||
function client.focus.global_bydirection(dir, c)
|
||||
screen = screen or require("awful.screen")
|
||||
local sel = c or capi.client.focus
|
||||
|
@ -316,8 +336,9 @@ function client.focus.global_bydirection(dir, c)
|
|||
end
|
||||
|
||||
--- Focus a client by its relative index.
|
||||
--
|
||||
-- @param i The index.
|
||||
-- @param c Optional client.
|
||||
-- @client[opt] c The client.
|
||||
function client.focus.byidx(i, c)
|
||||
local target = client.next(i, c)
|
||||
if target then
|
||||
|
@ -327,7 +348,7 @@ end
|
|||
|
||||
--- Swap a client with another client in the given direction
|
||||
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
||||
-- @param c Optional client.
|
||||
-- @client[opt] c The client.
|
||||
function client.swap.bydirection(dir, c)
|
||||
local sel = c or capi.client.focus
|
||||
if sel then
|
||||
|
@ -347,7 +368,7 @@ end
|
|||
|
||||
--- Swap a client with another client in the given direction. Swaps across screens.
|
||||
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
||||
-- @param c Optional client.
|
||||
-- @client[opt] c The client.
|
||||
function client.swap.global_bydirection(dir, c)
|
||||
screen = screen or require("awful.screen")
|
||||
local sel = c or capi.client.focus
|
||||
|
@ -382,7 +403,7 @@ end
|
|||
|
||||
--- Swap a client by its relative index.
|
||||
-- @param i The index.
|
||||
-- @param c Optional client, otherwise focused one is used.
|
||||
-- @client[opt] c The client, otherwise focused one is used.
|
||||
function client.swap.byidx(i, c)
|
||||
local sel = c or capi.client.focus
|
||||
local target = client.next(i, sel)
|
||||
|
@ -392,8 +413,9 @@ function client.swap.byidx(i, c)
|
|||
end
|
||||
|
||||
--- Cycle clients.
|
||||
--
|
||||
-- @param clockwise True to cycle clients clockwise.
|
||||
-- @param screen Optional screen where to cycle clients.
|
||||
-- @param[opt] screen The screen where to cycle clients.
|
||||
function client.cycle(clockwise, screen)
|
||||
local screen = screen or capi.mouse.screen
|
||||
local cls = client.visible(screen)
|
||||
|
@ -413,7 +435,8 @@ function client.cycle(clockwise, screen)
|
|||
end
|
||||
|
||||
--- Get the master window.
|
||||
-- @param screen Optional screen number, otherwise screen mouse is used.
|
||||
--
|
||||
-- @param[opt] screen The screen number, otherwise screen mouse is used.
|
||||
-- @return The master window.
|
||||
function client.getmaster(screen)
|
||||
local s = screen or capi.mouse.screen
|
||||
|
@ -421,7 +444,8 @@ function client.getmaster(screen)
|
|||
end
|
||||
|
||||
--- Set the client as master: put it at the beginning of other windows.
|
||||
-- @param c The window to set as master.
|
||||
--
|
||||
-- @client c The window to set as master.
|
||||
function client.setmaster(c)
|
||||
local cls = util.table.reverse(capi.client.get(c.screen))
|
||||
for k, v in pairs(cls) do
|
||||
|
@ -430,7 +454,7 @@ function client.setmaster(c)
|
|||
end
|
||||
|
||||
--- Set the client as slave: put it at the end of other windows.
|
||||
-- @param c The window to set as slave.
|
||||
-- @client c The window to set as slave.
|
||||
function client.setslave(c)
|
||||
local cls = capi.client.get(c.screen)
|
||||
for k, v in pairs(cls) do
|
||||
|
@ -443,7 +467,7 @@ end
|
|||
-- @param y The relative y coordinate.
|
||||
-- @param w The relative width.
|
||||
-- @param h The relative height.
|
||||
-- @param c The optional client, otherwise focused one is used.
|
||||
-- @client[opt] c The client, otherwise focused one is used.
|
||||
function client.moveresize(x, y, w, h, c)
|
||||
local sel = c or capi.client.focus
|
||||
local geometry = sel:geometry()
|
||||
|
@ -456,7 +480,7 @@ end
|
|||
|
||||
--- Move a client to a tag.
|
||||
-- @param target The tag to move the client to.
|
||||
-- @param c Optional client to move, otherwise the focused one is used.
|
||||
-- @client[opt] c The client to move, otherwise the focused one is used.
|
||||
function client.movetotag(target, c)
|
||||
local sel = c or capi.client.focus
|
||||
local s = tag.getscreen(target)
|
||||
|
@ -469,7 +493,7 @@ end
|
|||
|
||||
--- Toggle a tag on a client.
|
||||
-- @param target The tag to toggle.
|
||||
-- @param c Optional client to toggle, otherwise the focused one is used.
|
||||
-- @client[opt] c The client to toggle, otherwise the focused one is used.
|
||||
function client.toggletag(target, c)
|
||||
local sel = c or capi.client.focus
|
||||
-- Check that tag and client screen are identical
|
||||
|
@ -494,7 +518,7 @@ function client.toggletag(target, c)
|
|||
end
|
||||
|
||||
--- Move a client to a screen. Default is next screen, cycling.
|
||||
-- @param c The client to move.
|
||||
-- @client c The client to move.
|
||||
-- @param s The screen number, default to current + 1.
|
||||
function client.movetoscreen(c, s)
|
||||
screen = screen or require("awful.screen")
|
||||
|
@ -511,7 +535,7 @@ function client.movetoscreen(c, s)
|
|||
end
|
||||
|
||||
--- Mark a client, and then call 'marked' hook.
|
||||
-- @param c The client to mark, the focused one if not specified.
|
||||
-- @client c The client to mark, the focused one if not specified.
|
||||
-- @return True if the client has been marked. False if the client was already marked.
|
||||
function client.mark(c)
|
||||
local cl = c or capi.client.focus
|
||||
|
@ -531,7 +555,7 @@ function client.mark(c)
|
|||
end
|
||||
|
||||
--- Unmark a client and then call 'unmarked' hook.
|
||||
-- @param c The client to unmark, or the focused one if not specified.
|
||||
-- @client c The client to unmark, or the focused one if not specified.
|
||||
-- @return True if the client has been unmarked. False if the client was not marked.
|
||||
function client.unmark(c)
|
||||
local cl = c or capi.client.focus
|
||||
|
@ -548,7 +572,7 @@ function client.unmark(c)
|
|||
end
|
||||
|
||||
--- Check if a client is marked.
|
||||
-- @param c The client to check, or the focused one otherwise.
|
||||
-- @client c The client to check, or the focused one otherwise.
|
||||
function client.ismarked(c)
|
||||
local cl = c or capi.client.focus
|
||||
if cl then
|
||||
|
@ -562,7 +586,7 @@ function client.ismarked(c)
|
|||
end
|
||||
|
||||
--- Toggle a client as marked.
|
||||
-- @param c The client to toggle mark.
|
||||
-- @client c The client to toggle mark.
|
||||
function client.togglemarked(c)
|
||||
local cl = c or capi.client.focus
|
||||
|
||||
|
@ -585,7 +609,7 @@ end
|
|||
|
||||
--- Set a client floating state, overriding auto-detection.
|
||||
-- Floating client are not handled by tiling layouts.
|
||||
-- @param c A client.
|
||||
-- @client c A client.
|
||||
-- @param s True or false.
|
||||
function client.floating.set(c, s)
|
||||
local c = c or capi.client.focus
|
||||
|
@ -617,7 +641,7 @@ end)
|
|||
capi.client.connect_signal("property::geometry", store_floating_geometry)
|
||||
|
||||
--- Return if a client has a fixe size or not.
|
||||
-- @param c The client.
|
||||
-- @client c The client.
|
||||
function client.isfixed(c)
|
||||
local c = c or capi.client.focus
|
||||
if not c then return end
|
||||
|
@ -634,7 +658,7 @@ function client.isfixed(c)
|
|||
end
|
||||
|
||||
--- Get a client floating state.
|
||||
-- @param c A client.
|
||||
-- @client c A client.
|
||||
-- @return True or false. Note that some windows might be floating even if you
|
||||
-- did not set them manually. For example, windows with a type different than
|
||||
-- normal.
|
||||
|
@ -657,7 +681,7 @@ function client.floating.get(c)
|
|||
end
|
||||
|
||||
--- Toggle the floating state of a client between 'auto' and 'true'.
|
||||
-- @param c A client.
|
||||
-- @client c A client.
|
||||
function client.floating.toggle(c)
|
||||
local c = c or capi.client.focus
|
||||
-- If it has been set to floating
|
||||
|
@ -696,7 +720,7 @@ function client.restore(s)
|
|||
return nil
|
||||
end
|
||||
|
||||
-- Normalize a set of numbers to 1
|
||||
--- Normalize a set of numbers to 1
|
||||
-- @param set the set of numbers to normalize
|
||||
-- @param num the number of numbers to normalize
|
||||
local function normalize(set, num)
|
||||
|
@ -722,7 +746,8 @@ end
|
|||
|
||||
--- Calculate a client's column number, index in that column, and
|
||||
-- number of visible clients in this column.
|
||||
-- @param c the client
|
||||
--
|
||||
-- @client c the client
|
||||
-- @return col the column number
|
||||
-- @return idx index of the client in the column
|
||||
-- @return num the number of visible clients in the column
|
||||
|
@ -776,8 +801,9 @@ end
|
|||
|
||||
|
||||
--- Set the window factor of a client
|
||||
--
|
||||
-- @param wfact the window factor value
|
||||
-- @param c the client
|
||||
-- @client c the client
|
||||
function client.setwfact(wfact, c)
|
||||
-- get the currently selected window
|
||||
local c = c or capi.client.focus
|
||||
|
@ -815,8 +841,9 @@ function client.setwfact(wfact, c)
|
|||
end
|
||||
|
||||
--- Increment a client's window factor
|
||||
--
|
||||
-- @param add amount to increase the client's window
|
||||
-- @param c the client
|
||||
-- @client c the client
|
||||
function client.incwfact(add, c)
|
||||
local c = c or capi.client.focus
|
||||
if not c then return end
|
||||
|
@ -838,10 +865,11 @@ function client.incwfact(add, c)
|
|||
end
|
||||
|
||||
--- Get a client dockable state.
|
||||
-- @param c A client.
|
||||
--
|
||||
-- @client c A client.
|
||||
-- @return True or false. Note that some windows might be dockable even if you
|
||||
-- did not set them manually. For example, windows with a type "utility", "toolbar"
|
||||
-- or "dock"
|
||||
-- did not set them manually. For example, windows with a type "utility",
|
||||
-- "toolbar" or "dock"
|
||||
function client.dockable.get(c)
|
||||
local value = client.property.get(c, "dockable")
|
||||
|
||||
|
@ -860,14 +888,16 @@ end
|
|||
--- Set a client dockable state, overriding auto-detection.
|
||||
-- With this enabled you can dock windows by moving them from the center
|
||||
-- to the edge of the workarea.
|
||||
-- @param c A client.
|
||||
--
|
||||
-- @client c A client.
|
||||
-- @param value True or false.
|
||||
function client.dockable.set(c, value)
|
||||
client.property.set(c, "dockable", value)
|
||||
end
|
||||
|
||||
--- Get a client property.
|
||||
-- @param c The client.
|
||||
--
|
||||
-- @client c The client.
|
||||
-- @param prop The property name.
|
||||
-- @return The property.
|
||||
function client.property.get(c, prop)
|
||||
|
@ -886,8 +916,9 @@ function client.property.get(c, prop)
|
|||
end
|
||||
|
||||
--- Set a client property.
|
||||
-- This properties are internal to awful. Some are used to move clients, etc.
|
||||
-- @param c The client.
|
||||
-- These properties are internal to awful. Some are used to move clients, etc.
|
||||
--
|
||||
-- @client c The client.
|
||||
-- @param prop The property name.
|
||||
-- @param value The value.
|
||||
function client.property.set(c, prop, value)
|
||||
|
@ -902,9 +933,10 @@ function client.property.set(c, prop, value)
|
|||
end
|
||||
|
||||
--- Set a client property to be persistent across restarts (via X properties).
|
||||
--
|
||||
-- @param prop The property name.
|
||||
-- @param type The type (used for register_xproperty).
|
||||
-- One of "string", "number" or "boolean".
|
||||
-- One of "string", "number" or "boolean".
|
||||
function client.property.persist(prop, type)
|
||||
local xprop = "awful.client.property." .. prop
|
||||
capi.awesome.register_xproperty(xprop, type)
|
||||
|
@ -924,11 +956,10 @@ end
|
|||
--
|
||||
-- @param filter a function that returns true to indicate a positive match
|
||||
-- @param start what index to start iterating from. Defaults to using the
|
||||
-- index of the currently focused client.
|
||||
-- @param s which screen to use. nil means all screens.
|
||||
-- index of the currently focused client.
|
||||
-- @param s which screen to use. nil means all screens.
|
||||
--
|
||||
-- @usage
|
||||
-- -- e.g. to un-minimize all urxvt instances:
|
||||
-- @usage -- un-minimize all urxvt instances
|
||||
-- local urxvt = function (c)
|
||||
-- return awful.rules.match(c, {class = "URxvt"})
|
||||
-- end
|
||||
|
@ -943,23 +974,20 @@ function client.iterate(filter, start, s)
|
|||
return util.table.iterate(clients, filter, start)
|
||||
end
|
||||
|
||||
---
|
||||
-- Switch to a client matching the given condition if running, else spawn it.
|
||||
--
|
||||
--- Switch to a client matching the given condition if running, else spawn it.
|
||||
-- If multiple clients match the given condition then the next one is
|
||||
-- focussed.
|
||||
--
|
||||
-- @param cmd the command to execute
|
||||
-- @param cmd the command to execute
|
||||
-- @param matcher a function that returns true to indicate a matching client
|
||||
-- @param merge if true then merge tags when clients are not visible
|
||||
-- @param merge if true then merge tags when clients are not visible
|
||||
--
|
||||
-- @usage
|
||||
-- -- run or raise urxvt (perhaps, with tabs) on modkey + semicolon
|
||||
-- @usage -- run or raise urxvt (perhaps, with tabs) on modkey + semicolon
|
||||
-- awful.key({ modkey, }, 'semicolon', function ()
|
||||
-- local matcher = function (c)
|
||||
-- return awful.rules.match(c, {class = 'URxvt'})
|
||||
-- end
|
||||
-- awful.client.run_or_raise('urxvt', matcher)
|
||||
-- local matcher = function (c)
|
||||
-- return awful.rules.match(c, {class = 'URxvt'})
|
||||
-- end
|
||||
-- awful.client.run_or_raise('urxvt', matcher)
|
||||
-- end);
|
||||
function client.run_or_raise(cmd, matcher, merge)
|
||||
local clients = capi.client.get()
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Handle client shapes.
|
||||
--
|
||||
-- @author Uli Schlachter <psychon@znc.in>
|
||||
-- @copyright 2014 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.client.shape
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -12,14 +15,12 @@ local capi =
|
|||
client = client,
|
||||
}
|
||||
|
||||
--- Handle client shapes.
|
||||
-- awful.client.shape
|
||||
local shape = {}
|
||||
shape.update = {}
|
||||
|
||||
--- Get one of a client's shapes and transform it to include window decorations
|
||||
-- @param c The client whose shape should be retrieved
|
||||
-- @param shape Either "bounding" or "clip"
|
||||
-- @client c The client whose shape should be retrieved
|
||||
-- @tparam string shape Either "bounding" or "clip"
|
||||
function shape.get_transformed(c, shape)
|
||||
local border = shape == "bounding" and c.border_width or 0
|
||||
local shape = surface(c["client_shape_" .. shape])
|
||||
|
@ -51,7 +52,7 @@ function shape.get_transformed(c, shape)
|
|||
end
|
||||
|
||||
--- Update a client's bounding shape from the shape the client set itself
|
||||
-- @param c The client to act on
|
||||
-- @client c The client to act on
|
||||
function shape.update.bounding(c)
|
||||
local res = shape.get_transformed(c, "bounding")
|
||||
c.shape_bounding = res and res._native
|
||||
|
@ -62,7 +63,7 @@ function shape.update.bounding(c)
|
|||
end
|
||||
|
||||
--- Update a client's clip shape from the shape the client set itself
|
||||
-- @param c The client to act on
|
||||
-- @client c The client to act on
|
||||
function shape.update.clip(c)
|
||||
local res = shape.get_transformed(c, "clip")
|
||||
c.shape_clip = res and res._native
|
||||
|
@ -73,7 +74,7 @@ function shape.update.clip(c)
|
|||
end
|
||||
|
||||
--- Update all of a client's shapes from the shapes the client set itself
|
||||
-- @param c The client to act on
|
||||
-- @client c The client to act on
|
||||
function shape.update.all(c)
|
||||
shape.update.bounding(c)
|
||||
shape.update.clip(c)
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Completion module.
|
||||
--
|
||||
-- This module store a set of function using shell to complete commands name.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @author Sébastien Gross <seb-awesome@chezwam.org>
|
||||
-- @copyright 2008 Julien Danjou, Sébastien Gross
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.completion
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -15,9 +20,6 @@ local pairs = pairs
|
|||
local string = string
|
||||
local util = require("awful.util")
|
||||
|
||||
--- Completion module.
|
||||
-- This module store a set of function using shell to complete commands name.
|
||||
-- awful.completion
|
||||
local completion = {}
|
||||
|
||||
-- mapping of command/completion function
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- D-Bus module for awful.
|
||||
--
|
||||
-- This module simply request the org.naquadah.awesome.awful name on the D-Bus
|
||||
-- for futur usage by other awful modules.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.dbus
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
local dbus = dbus
|
||||
|
||||
--- D-Bus module for awful.
|
||||
-- This module simply request the org.naquadah.awesome.awful name on the D-Bus
|
||||
-- for futur usage by other awful modules.
|
||||
-- awful.dbus
|
||||
|
||||
if dbus then
|
||||
dbus.request_name("session", "org.naquadah.awesome.awful")
|
||||
end
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Implements EWMH requests handling.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.ewmh
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -12,8 +15,6 @@ local math = math
|
|||
local atag = require("awful.tag")
|
||||
local aclient = require("awful.client")
|
||||
|
||||
--- Implements EWMH requests handling.
|
||||
-- awful.ewmh
|
||||
local ewmh = {}
|
||||
|
||||
local data = setmetatable({}, { __mode = 'k' })
|
||||
|
@ -25,7 +26,8 @@ local function store_geometry(window, reqtype)
|
|||
data[window][reqtype].screen = window.screen
|
||||
end
|
||||
|
||||
-- Maximize a window horizontally.
|
||||
--- Maximize a window horizontally.
|
||||
--
|
||||
-- @param window The window.
|
||||
-- @param set Set or unset the maximized values.
|
||||
local function maximized_horizontal(window, set)
|
||||
|
@ -42,7 +44,8 @@ local function maximized_horizontal(window, set)
|
|||
end
|
||||
end
|
||||
|
||||
-- Maximize a window vertically.
|
||||
--- Maximize a window vertically.
|
||||
--
|
||||
-- @param window The window.
|
||||
-- @param set Set or unset the maximized values.
|
||||
local function maximized_vertical(window, set)
|
||||
|
@ -59,7 +62,8 @@ local function maximized_vertical(window, set)
|
|||
end
|
||||
end
|
||||
|
||||
-- Fullscreen a window.
|
||||
--- Fullscreen a window.
|
||||
--
|
||||
-- @param window The window.
|
||||
-- @param set Set or unset the fullscreen values.
|
||||
local function fullscreen(window, set)
|
||||
|
@ -115,7 +119,7 @@ local function screen_change(window)
|
|||
end
|
||||
end
|
||||
|
||||
-- Update a client's settings when its geometry changes, skipping signals
|
||||
--- Update a client's settings when its geometry changes, skipping signals
|
||||
-- resulting from calls within.
|
||||
local geometry_change_lock = false
|
||||
local function geometry_change(window)
|
||||
|
@ -139,7 +143,9 @@ local function geometry_change(window)
|
|||
geometry_change_lock = false
|
||||
end
|
||||
|
||||
-- Activate a window
|
||||
--- Activate a window
|
||||
--
|
||||
-- @client c A client to use
|
||||
function ewmh.activate(c)
|
||||
if awesome.startup or c:isvisible() then
|
||||
client.focus = c
|
||||
|
@ -149,7 +155,10 @@ function ewmh.activate(c)
|
|||
end
|
||||
end
|
||||
|
||||
-- Tag a window with its requested tag
|
||||
--- Tag a window with its requested tag
|
||||
--
|
||||
-- @client c A client to tag
|
||||
-- @tag[opt] t A tag to use. If omitted, then the client is made sticky.
|
||||
function ewmh.tag(c, t)
|
||||
if not t then
|
||||
c.sticky = true
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- AWesome Functions very UsefuL
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- AWesome Functions very UsefuL
|
||||
-- awful
|
||||
|
||||
-- TODO: This is a hack for backwards-compatibility with 3.5, remove!
|
||||
local util = require("awful.util")
|
||||
local gtimer = require("gears.timer")
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Create easily new key objects ignoring certain modifiers.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.key
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -10,8 +13,6 @@ local ipairs = ipairs
|
|||
local capi = { key = key }
|
||||
local util = require("awful.util")
|
||||
|
||||
--- Create easily new key objects ignoring certain modifiers.
|
||||
-- awful.key
|
||||
local key = { mt = {} }
|
||||
|
||||
--- Modifiers to ignore.
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Keygrabber Stack
|
||||
--
|
||||
-- @author dodo
|
||||
-- @copyright 2012 dodo
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.keygrabber
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local ipairs = ipairs
|
||||
|
@ -9,8 +12,6 @@ local table = table
|
|||
local capi = {
|
||||
keygrabber = keygrabber }
|
||||
|
||||
--- Keygrabber Stack
|
||||
-- awful.keygrabber
|
||||
local keygrabber = {}
|
||||
|
||||
-- Private data
|
||||
|
@ -53,16 +54,15 @@ end
|
|||
-- to the top of the stack.
|
||||
--
|
||||
-- The callback function receives three arguments:
|
||||
-- <ul>
|
||||
-- <li>a table containing modifiers keys</li>
|
||||
-- <li>a string with the pressed key</li>
|
||||
-- <li>a string with either "press" or "release" to indicate the event type</li>
|
||||
-- </ul>
|
||||
--
|
||||
-- A callback can return <code>false</code> to pass the events to the next
|
||||
-- * a table containing modifiers keys
|
||||
-- * a string with the pressed key
|
||||
-- * a string with either "press" or "release" to indicate the event type
|
||||
--
|
||||
-- A callback can return `false` to pass the events to the next
|
||||
-- keygrabber in the stack.
|
||||
-- @param g The key grabber callback that will get the key events until it will be deleted or a new grabber is added.
|
||||
-- @return the given callback <code>g</code>.
|
||||
-- @return the given callback `g`.
|
||||
-- @usage
|
||||
-- -- The following function can be bound to a key, and be used to resize a
|
||||
-- -- client using the keyboard.
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Layout module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -18,9 +21,11 @@ local capi = {
|
|||
local client = require("awful.client")
|
||||
local timer = require("gears.timer")
|
||||
|
||||
--- Layout module for awful
|
||||
-- awful.layout
|
||||
local layout = {}
|
||||
|
||||
--- Default predefined layouts
|
||||
--
|
||||
-- @fixme Add documentation on available layouts as all of them are hidden
|
||||
layout.suit = require("awful.layout.suit")
|
||||
|
||||
-- The default list of layouts
|
||||
|
@ -56,7 +61,7 @@ end
|
|||
--- Change the layout of the current tag.
|
||||
-- @param i Relative index.
|
||||
-- @param s The screen number.
|
||||
-- @param layouts A table of layouts. (optional)
|
||||
-- @param[opt] layouts A table of layouts.
|
||||
function layout.inc(i, s, layouts)
|
||||
local t = tag.selected(s)
|
||||
local layouts = layouts or layout.layouts
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Fair layouts module for awful
|
||||
--
|
||||
-- @author Josh Komoroske
|
||||
-- @copyright 2012 Josh Komoroske
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout.suit.fair
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
local ipairs = ipairs
|
||||
local math = math
|
||||
|
||||
--- Fair layouts module for awful
|
||||
-- awful.layout.suit.fair
|
||||
local fair = {}
|
||||
|
||||
local function do_fair(p, orientation)
|
||||
|
@ -86,7 +87,7 @@ function fair.horizontal.arrange(p)
|
|||
return do_fair(p, "east")
|
||||
end
|
||||
|
||||
-- Vertical fair layout.
|
||||
--- Vertical fair layout.
|
||||
-- @param screen The screen to arrange.
|
||||
fair.name = "fairv"
|
||||
function fair.arrange(p)
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Dummy function for floating layout
|
||||
--
|
||||
-- @author Gregor Best
|
||||
-- @copyright 2008 Gregor Best
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout.suit.floating
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- Dummy function for floating layout
|
||||
-- Grab environment we need
|
||||
local math = math
|
||||
local ipairs = ipairs
|
||||
|
@ -14,7 +16,6 @@ local capi =
|
|||
mousegrabber = mousegrabber
|
||||
}
|
||||
|
||||
-- awful.layout.suit.floating
|
||||
local floating = {}
|
||||
|
||||
function floating.mouse_resize_handler(c, corner, x, y)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Suits for awful
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout.suit
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- Suits for awful
|
||||
|
||||
return
|
||||
{
|
||||
max = require("awful.layout.suit.max");
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Magnifier layout module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout.suit.magnifier
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -17,8 +20,6 @@ local capi =
|
|||
}
|
||||
local client = require("awful.client")
|
||||
|
||||
--- Magnifier layout module for awful
|
||||
-- awful.layout.suit.magnifier
|
||||
local magnifier = {}
|
||||
|
||||
function magnifier.mouse_resize_handler(c, corner, x, y)
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Maximized and fullscreen layouts module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout.suit.max
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
local pairs = pairs
|
||||
local client = require("awful.client")
|
||||
|
||||
--- Maximized and fullscreen layouts module for awful
|
||||
-- awful.layout.suit.max
|
||||
local max = {}
|
||||
|
||||
local function fmax(p, fs)
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Dwindle and spiral layouts
|
||||
--
|
||||
-- @author Uli Schlachter <psychon@znc.in>
|
||||
-- @copyright 2009 Uli Schlachter
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
--
|
||||
-- @module awful.layout.suit.spiral
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
local ipairs = ipairs
|
||||
local math = math
|
||||
|
||||
-- awful.layout.suit.spiral
|
||||
local spiral = {}
|
||||
|
||||
local function do_spiral(p, _spiral)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Tiled layouts module for awful
|
||||
--
|
||||
-- @author Donald Ephraim Curtis <dcurtis@cs.uiowa.edu>
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Donald Ephraim Curtis
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.layout.suit.tile
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -18,8 +21,6 @@ local capi =
|
|||
mousegrabber = mousegrabber
|
||||
}
|
||||
|
||||
--- Tiled layouts module for awful
|
||||
-- awful.layout.suit.tile
|
||||
local tile = {}
|
||||
|
||||
local function mouse_resize_handler(c, corner, x, y, orientation)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
--------------------------------------------------------------------------------
|
||||
--- A menu for awful
|
||||
--
|
||||
-- @author Damien Leone <damien.leone@gmail.com>
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @author dodo
|
||||
-- @copyright 2008, 2011 Damien Leone, Julien Danjou, dodo
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.menu
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local wibox = require("wibox")
|
||||
|
@ -31,7 +34,6 @@ local capi = {
|
|||
client = client }
|
||||
|
||||
|
||||
-- awful.menu
|
||||
local menu = { mt = {} }
|
||||
|
||||
|
||||
|
@ -308,6 +310,7 @@ end
|
|||
|
||||
|
||||
--- Show a menu.
|
||||
-- @param args The arguments
|
||||
-- @param args.coords Menu position defaulting to mouse.coords()
|
||||
function menu:show(args)
|
||||
args = args or {}
|
||||
|
@ -338,7 +341,7 @@ function menu:hide()
|
|||
end
|
||||
|
||||
--- Toggle menu visibility.
|
||||
-- @param _menu The menu to show if it's hidden, or to hide if it's shown.
|
||||
-- @param args The arguments
|
||||
-- @param args.coords Menu position {x,y}
|
||||
function menu:toggle(args)
|
||||
if self.wibox.visible then
|
||||
|
@ -363,11 +366,11 @@ function menu:get_root()
|
|||
end
|
||||
|
||||
--- Add a new menu entry.
|
||||
-- args.new (Default: awful.menu.entry) The menu entry constructor.
|
||||
-- args.theme (Optional) The menu entry theme.
|
||||
-- args.* params needed for the menu entry constructor.
|
||||
-- @param args The item params
|
||||
-- @param index (Optional) the index where the new entry will inserted
|
||||
-- @param args.new (Default: awful.menu.entry) The menu entry constructor.
|
||||
-- @param[opt] args.theme The menu entry theme.
|
||||
-- @param[opt] index The index where the new entry will inserted.
|
||||
function menu:add(args, index)
|
||||
if not args then return end
|
||||
local theme = load_theme(args.theme or {}, self.theme)
|
||||
|
@ -422,8 +425,7 @@ function menu:add(args, index)
|
|||
return item
|
||||
end
|
||||
|
||||
-- Delete menu entry at given position
|
||||
-- @param _menu The menu
|
||||
--- Delete menu entry at given position
|
||||
-- @param num The position in the table of the menu entry to be deleted; can be also the menu entry itself
|
||||
function menu:delete(num)
|
||||
if type(num) == "table" then
|
||||
|
@ -585,18 +587,18 @@ end
|
|||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Create a menu popup.
|
||||
-- @param args Table containing the menu informations.<br/>
|
||||
-- <ul>
|
||||
-- <li> Key items: Table containing the displayed items. Each element is a table by default (when element 'new' is awful.menu.entry) containing: item name, triggered action, submenu table or function, item icon (optional). </li>
|
||||
-- <li> Keys theme.[fg|bg]_[focus|normal], theme.border_color, theme.border_width, theme.submenu_icon, theme.height and theme.width override the default display for your menu and/or of your menu entry, each of them are optional. </li>
|
||||
-- <li> Key auto_expand controls the submenu auto expand behaviour by setting it to true (default) or false. </li>
|
||||
-- </ul>
|
||||
-- @param args Table containing the menu informations.
|
||||
--
|
||||
-- * Key items: Table containing the displayed items. Each element is a table by default (when element 'new' is awful.menu.entry) containing: item name, triggered action, submenu table or function, item icon (optional).
|
||||
-- * Keys theme.[fg|bg]_[focus|normal], theme.border_color, theme.border_width, theme.submenu_icon, theme.height and theme.width override the default display for your menu and/or of your menu entry, each of them are optional.
|
||||
-- * Key auto_expand controls the submenu auto expand behaviour by setting it to true (default) or false.
|
||||
--
|
||||
-- @param parent Specify the parent menu if we want to open a submenu, this value should never be set by the user.
|
||||
-- @usage -- The following function builds and shows a menu of clients that match
|
||||
-- -- a particular rule.
|
||||
-- -- Bound to a key, it can be used to select from dozens of terminals open on
|
||||
-- -- several tags.
|
||||
-- -- When using @{awful.rules.match_any} instead of @{awful.rules.match},
|
||||
-- -- When using @{rules.match_any} instead of @{rules.match},
|
||||
-- -- a menu of clients with different classes could be build.
|
||||
--
|
||||
-- function terminal_menu ()
|
||||
|
|
|
@ -1,7 +1,41 @@
|
|||
-------------------------------------------------------------------------
|
||||
--- Mouse finder for awful
|
||||
--
|
||||
-- Find the mouse pointer on the screen.
|
||||
-- Mouse finder highlights the mouse cursor on the screen
|
||||
-- To enable this feature, a `awful.mouse.finder` object needs to be bound to a
|
||||
-- key:
|
||||
--
|
||||
-- mymousefinder = awful.mouse.finder()
|
||||
--
|
||||
-- Then bind the `find` function a key binding.
|
||||
--
|
||||
-- Some configuration variable can be set in the theme:
|
||||
--
|
||||
-- The mouse_finder display duration
|
||||
--
|
||||
-- theme.mouse_finder_timeout = 3
|
||||
--
|
||||
-- The animation speed
|
||||
--
|
||||
-- theme.mouse_finder_animate_timeout = 0.05
|
||||
--
|
||||
-- The mouse_finder radius
|
||||
--
|
||||
-- theme.mouse_finder_radius = 20
|
||||
--
|
||||
-- The growth factor
|
||||
--
|
||||
-- theme.mouse_finder_factor = 2
|
||||
--
|
||||
-- The mouse_finder color
|
||||
--
|
||||
-- theme.mouse_finder_color = "#ff0000"
|
||||
--
|
||||
-- @author Sébastien Gross <seb•ɱɩɲʋʃ•awesome•ɑƬ•chezwam•ɖɵʈ•org>
|
||||
-- @copyright 2009 Sébastien Gross
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.mouse.finder
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
local mouse = mouse
|
||||
|
@ -13,30 +47,10 @@ local a_wibox = require("awful.wibox")
|
|||
local beautiful = require("beautiful")
|
||||
local setmetatable = setmetatable
|
||||
|
||||
--- Find the mouse pointer on the screen.
|
||||
-- Mouse finder highlights the mouse cursor on the screen
|
||||
-- <p>To enable this feature, a <code>awful.mouse.finder</code> object needs to
|
||||
-- be bound to a key:<br/>
|
||||
-- <code>mymousefinder = awful.mouse.finder()</code><br/>
|
||||
-- Then bind the <code>find</code> function a key binding.
|
||||
-- <p>Some configuration variable can be set in the theme:<br/>
|
||||
-- The mouse_finder display duration<br/>
|
||||
-- <code>theme.mouse_finder_timeout = 3</code><br/>
|
||||
-- The animation speed<br/>
|
||||
-- <code>theme.mouse_finder_animate_timeout = 0.05</code><br/>
|
||||
-- The mouse_finder radius<br/>
|
||||
-- <code>theme.mouse_finder_radius = 20</code><br/>
|
||||
-- The growth factor<br/>
|
||||
-- <code>theme.mouse_finder_factor = 2</code><br/>
|
||||
-- The mouse_finder color<br/>
|
||||
-- <code>theme.mouse_finder_color = "#ff0000"</code><br/>
|
||||
-- </p>
|
||||
|
||||
-- awful.mouse.finder
|
||||
local finder = { mt = {} }
|
||||
|
||||
-- Mouse finder private data.
|
||||
-- @name data
|
||||
--- Mouse finder private data.
|
||||
-- @table data
|
||||
-- @field color Background color.
|
||||
-- @field hide The hide() function.
|
||||
-- @field show The show() function.
|
||||
|
@ -45,14 +59,14 @@ local finder = { mt = {} }
|
|||
-- @field wibox The mouse finder wibox show on the screen.
|
||||
local data = setmetatable({}, { __mode = 'k' })
|
||||
|
||||
-- Place a mouse finder on the screen.
|
||||
--- Place a mouse finder on the screen.
|
||||
-- @param self A mouse finder object.
|
||||
local function place(self)
|
||||
a_placement.under_mouse(data[self].wibox)
|
||||
a_placement.no_offscreen(data[self].wibox)
|
||||
end
|
||||
|
||||
-- Animate a mouse finder.
|
||||
--- Animate a mouse finder.
|
||||
-- @param self A mouse finder object.
|
||||
local function animate(self)
|
||||
local r = data[self].wibox:geometry().width
|
||||
|
@ -74,7 +88,7 @@ local function animate(self)
|
|||
end
|
||||
|
||||
|
||||
-- Show a mouse finder.
|
||||
--- Show a mouse finder.
|
||||
-- @param self The mouse finder to show.
|
||||
local function show(self)
|
||||
-- do nothing if the mouse finder is already shown
|
||||
|
@ -90,7 +104,7 @@ local function show(self)
|
|||
data[self].wibox.visible = true
|
||||
end
|
||||
|
||||
-- Hide a mouse finder.
|
||||
--- Hide a mouse finder.
|
||||
-- @param self The mouse finder to hide.
|
||||
local function hide(self)
|
||||
-- do nothing if the mouse finder is already hidden
|
||||
|
@ -102,7 +116,7 @@ local function hide(self)
|
|||
data[self].wibox.visible = false
|
||||
end
|
||||
|
||||
-- Load Default values.
|
||||
--- Load Default values.
|
||||
-- @param self A mouse finder object.
|
||||
local function set_defaults(self)
|
||||
data[self].wibox.border_width = 0
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Mouse module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.mouse
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -25,8 +28,6 @@ local capi =
|
|||
|
||||
local finder = require("awful.mouse.finder")
|
||||
|
||||
--- Mouse module for awful
|
||||
-- awful.mouse
|
||||
local mouse = {}
|
||||
|
||||
mouse.client = {}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Places client according to special criteria.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.placement
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -19,11 +22,9 @@ local client = require("awful.client")
|
|||
local layout = require("awful.layout")
|
||||
local a_screen = require("awful.screen")
|
||||
|
||||
--- Places client according to special criteria.
|
||||
-- awful.placement
|
||||
local placement = {}
|
||||
|
||||
-- Check if an area intersect another area.
|
||||
--- Check if an area intersect another area.
|
||||
-- @param a The area.
|
||||
-- @param b The other area.
|
||||
-- @return True if they intersect, false otherwise.
|
||||
|
@ -34,7 +35,7 @@ local function area_intersect_area(a, b)
|
|||
and b.y + b.height > a.y)
|
||||
end
|
||||
|
||||
-- Get the intersect area between a and b.
|
||||
--- Get the intersect area between a and b.
|
||||
-- @param a The area.
|
||||
-- @param b The other area.
|
||||
-- @return The intersect area.
|
||||
|
@ -47,7 +48,7 @@ local function area_intersect_area_get(a, b)
|
|||
return g
|
||||
end
|
||||
|
||||
-- Remove an area from a list, splitting the space between several area that
|
||||
--- Remove an area from a list, splitting the space between several area that
|
||||
-- can overlap.
|
||||
-- @param areas Table of areas.
|
||||
-- @param elem Area to remove.
|
||||
|
@ -193,7 +194,7 @@ end
|
|||
|
||||
--- Place the client centered with respect to a parent or the clients screen.
|
||||
-- @param c The client.
|
||||
-- @param p The parent (optional, nil for screen centering).
|
||||
-- @param[opt] p The parent (nil for screen centering).
|
||||
-- @return The new client geometry.
|
||||
function placement.centered(c, p)
|
||||
local c = c or capi.client.focus
|
||||
|
@ -211,7 +212,7 @@ end
|
|||
|
||||
--- Place the client centered on the horizontal axis with respect to a parent or the clients screen.
|
||||
-- @param c The client.
|
||||
-- @param p The parent (optional, nil for screen centering).
|
||||
-- @param[opt] p The parent (nil for screen centering).
|
||||
-- @return The new client geometry.
|
||||
function placement.center_horizontal(c, p)
|
||||
local c = c or capi.client.focus
|
||||
|
@ -228,7 +229,7 @@ end
|
|||
|
||||
--- Place the client centered on the vertical axis with respect to a parent or the clients screen.
|
||||
-- @param c The client.
|
||||
-- @param p The parent (optional, nil for screen centering).
|
||||
-- @param[opt] p The parent (nil for screen centering).
|
||||
-- @return The new client geometry.
|
||||
function placement.center_vertical(c, p)
|
||||
local c = c or capi.client.focus
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Prompt module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.prompt
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -19,8 +22,6 @@ local keygrabber = require("awful.keygrabber")
|
|||
local util = require("awful.util")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
--- Prompt module for awful
|
||||
-- awful.prompt
|
||||
local prompt = {}
|
||||
|
||||
--- Private data
|
||||
|
@ -34,9 +35,9 @@ local function itera (inc,a, i)
|
|||
if v then return i,v end
|
||||
end
|
||||
|
||||
-- Load history file in history table
|
||||
-- @param id The data.history identifier which is the path to the filename
|
||||
-- @param max Optional parameter, the maximum number of entries in file
|
||||
--- Load history file in history table
|
||||
-- @param id The data.history identifier which is the path to the filename.
|
||||
-- @param[opt] max The maximum number of entries in file.
|
||||
local function history_check_load(id, max)
|
||||
if id and id ~= ""
|
||||
and not data.history[id] then
|
||||
|
@ -63,7 +64,7 @@ local function history_check_load(id, max)
|
|||
end
|
||||
end
|
||||
|
||||
-- Save history table in history file
|
||||
--- Save history table in history file
|
||||
-- @param id The data.history identifier
|
||||
local function history_save(id)
|
||||
if data.history[id] then
|
||||
|
@ -83,7 +84,7 @@ local function history_save(id)
|
|||
end
|
||||
end
|
||||
|
||||
-- Return the number of items in history table regarding the id
|
||||
--- Return the number of items in history table regarding the id
|
||||
-- @param id The data.history identifier
|
||||
-- @return the number of items in history table, -1 if history is disabled
|
||||
local function history_items(id)
|
||||
|
@ -94,7 +95,7 @@ local function history_items(id)
|
|||
end
|
||||
end
|
||||
|
||||
-- Add an entry to the history file
|
||||
--- Add an entry to the history file
|
||||
-- @param id The data.history identifier
|
||||
-- @param command The command to add
|
||||
local function history_add(id, command)
|
||||
|
@ -119,16 +120,16 @@ local function history_add(id, command)
|
|||
end
|
||||
|
||||
|
||||
-- Draw the prompt text with a cursor.
|
||||
-- @param args The table of arguments.
|
||||
-- @param text The text.
|
||||
-- @param font The font.
|
||||
-- @param prompt The text prefix.
|
||||
-- @param text_color The text color.
|
||||
-- @param cursor_color The cursor color.
|
||||
-- @param cursor_pos The cursor position.
|
||||
-- @param cursor_ul The cursor underline style.
|
||||
-- @param selectall If true cursor is rendered on the entire text.
|
||||
--- Draw the prompt text with a cursor.
|
||||
-- @tparam table args The table of arguments.
|
||||
-- @field text The text.
|
||||
-- @field font The font.
|
||||
-- @field prompt The text prefix.
|
||||
-- @field text_color The text color.
|
||||
-- @field cursor_color The cursor color.
|
||||
-- @field cursor_pos The cursor position.
|
||||
-- @field cursor_ul The cursor underline style.
|
||||
-- @field selectall If true cursor is rendered on the entire text.
|
||||
local function prompt_text_with_cursor(args)
|
||||
local char, spacer, text_start, text_end, ret
|
||||
local text = args.text or ""
|
||||
|
@ -157,45 +158,45 @@ local function prompt_text_with_cursor(args)
|
|||
end
|
||||
|
||||
--- Run a prompt in a box.
|
||||
-- <p>The following readline keyboard shortcuts are implemented as expected:</p>
|
||||
--
|
||||
-- The following readline keyboard shortcuts are implemented as expected:
|
||||
-- <kbd>CTRL+A</kbd>, <kbd>CTRL+B</kbd>, <kbd>CTRL+C</kbd>, <kbd>CTRL+D</kbd>,
|
||||
-- <kbd>CTRL+E</kbd>, <kbd>CTRL+J</kbd>, <kbd>CTRL+M</kbd>, <kbd>CTRL+F</kbd>,
|
||||
-- <kbd>CTRL+H</kbd>, <kbd>CTRL+K</kbd>, <kbd>CTRL+U</kbd>, <kbd>CTRL+W</kbd>,
|
||||
-- <kbd>CTRL+BACKSPACE</kbd>, <kbd>SHIFT+INSERT</kbd>, <kbd>HOME</kbd>,
|
||||
-- <kbd>END</kbd> and arrow keys.
|
||||
-- <p>The following shortcuts implement additional history manipulation commands
|
||||
--
|
||||
-- The following shortcuts implement additional history manipulation commands
|
||||
-- where the search term is defined as the substring of the command from first
|
||||
-- character to cursor position.</p>
|
||||
-- <ul>
|
||||
-- <li><code>CTRL+R</code>: reverse history search, matches any history entry
|
||||
-- containing search term.</li>
|
||||
-- <li><code>CTRL+S</code>: forward history search, matches any history entry
|
||||
-- containing search term.</li>
|
||||
-- <li><code>CTRL+UP</code>: ZSH up line or search, matches any history entry
|
||||
-- starting with search term.</li>
|
||||
-- <li><code>CTRL+DOWN</code>: ZSH down line or search, matches any history
|
||||
-- entry starting with search term.</li>
|
||||
-- <li><code>CTRL+DELETE</code>: delete the currently visible history entry from
|
||||
-- history file.
|
||||
-- This does not delete new commands or history entries under user editing.</li>
|
||||
-- </ul>
|
||||
-- @param args A table with optional arguments: <code>fg_cursor</code>,
|
||||
-- <code>bg_cursor</code>, <code>ul_cursor</code>, <code>prompt</code>,
|
||||
-- <code>text</code>, <code>selectall</code>, <code>font</code>,
|
||||
-- <code>autoexec</code>.
|
||||
-- character to cursor position.
|
||||
--
|
||||
-- * <kbd>CTRL+R</kbd>: reverse history search, matches any history entry
|
||||
-- containing search term.
|
||||
-- * <kbd>CTRL+S</kbd>: forward history search, matches any history entry
|
||||
-- containing search term.
|
||||
-- * <kbd>CTRL+UP</kbd>: ZSH up line or search, matches any history entry
|
||||
-- starting with search term.
|
||||
-- * <kbd>CTRL+DOWN</kbd>: ZSH down line or search, matches any history
|
||||
-- entry starting with search term.
|
||||
-- * <kbd>CTRL+DELETE</kbd>: delete the currently visible history entry from
|
||||
-- history file. This does not delete new commands or history entries under
|
||||
-- user editing.
|
||||
--
|
||||
-- @tparam table args A table with optional arguments: `fg_cursor`, `bg_cursor`,
|
||||
-- `ul_cursor`, `prompt`, `text`, `selectall`, `font`, `autoexec`.
|
||||
-- @param textbox The textbox to use for the prompt.
|
||||
-- @param exe_callback The callback function to call with command as argument
|
||||
-- when finished.
|
||||
-- @param completion_callback The callback function to call to get completion.
|
||||
-- @param history_path Optional parameter: file path where the history should be
|
||||
-- @param[opt] history_path File path where the history should be
|
||||
-- saved, set nil to disable history
|
||||
-- @param history_max Optional parameter: set the maximum entries in history
|
||||
-- @param[opt] history_max Set the maximum entries in history
|
||||
-- file, 50 by default
|
||||
-- @param done_callback Optional parameter: the callback function to always call
|
||||
-- @param[opt] done_callback The callback function to always call
|
||||
-- without arguments, regardless of whether the prompt was cancelled.
|
||||
-- @param changed_callback Optional parameter: the callback function to call
|
||||
-- @param[opt] changed_callback The callback function to call
|
||||
-- with command as argument when a command was changed.
|
||||
-- @param keypressed_callback Optional parameter: the callback function to call
|
||||
-- @param[opt] keypressed_callback The callback function to call
|
||||
-- with mod table, key and command as arguments when a key was pressed.
|
||||
function prompt.run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback, changed_callback, keypressed_callback)
|
||||
local grabber
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Remote control module allowing usage of awesome-client.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.remote
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -14,9 +17,6 @@ local unpack = unpack or table.unpack -- v5.1: unpack, v5.2: table.unpack
|
|||
local dbus = dbus
|
||||
local type = type
|
||||
|
||||
--- Remote control module allowing usage of awesome-client.
|
||||
-- awful.remote
|
||||
|
||||
if dbus then
|
||||
dbus.connect_signal("org.naquadah.awesome.awful.Remote", function(data, code)
|
||||
if data.member == "Eval" then
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Apply rules to clients at startup.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.rules
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -13,102 +16,82 @@ local pairs = pairs
|
|||
local aclient = require("awful.client")
|
||||
local atag = require("awful.tag")
|
||||
|
||||
--- Apply rules to clients at startup.
|
||||
-- awful.rules
|
||||
local rules = {}
|
||||
|
||||
--- This is the global rules table.
|
||||
-- <p>You should fill this table with your rule and properties to apply.
|
||||
-- For example, if you want to set xterm maximized at startup, you can add:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = { class = "xterm" },
|
||||
-- properties = { maximized_vertical = true, maximized_horizontal = true } }
|
||||
-- </code>
|
||||
-- </p>
|
||||
-- <p>If you want to set mplayer floating at startup, you can add:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = { name = "MPlayer" },
|
||||
-- properties = { floating = true } }
|
||||
-- </code>
|
||||
-- </p>
|
||||
-- <p>If you want to put Firefox on a specific tag at startup, you
|
||||
-- can add:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = { instance = "firefox" },
|
||||
-- properties = { tag = mytagobject } }
|
||||
-- </code>
|
||||
-- </p>
|
||||
-- <p>If you want to put Emacs on a specific tag at startup, and
|
||||
-- immediately switch to that tag you can add:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = { class = "Emacs" },
|
||||
-- properties = { tag = mytagobject, switchtotag = true } }
|
||||
-- </code>
|
||||
-- </p>
|
||||
-- <p>If you want to apply a custom callback to execute when a rule matched,
|
||||
-- for example to pause playing music from mpd when you start dosbox, you
|
||||
-- can add:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = { class = "dosbox" },
|
||||
-- callback = function(c)
|
||||
-- awful.util.spawn('mpc pause')
|
||||
-- end }
|
||||
-- </code>
|
||||
-- </p>
|
||||
-- <p>Note that all "rule" entries need to match. If any of the entry does not
|
||||
-- match, the rule won't be applied.</p>
|
||||
-- <p>If a client matches multiple rules, their applied in the order they are
|
||||
-- put in this global rules table. If the value of a rule is a string, then the
|
||||
-- match function is used to determine if the client matches the rule.</p>
|
||||
-- <p>If the value of a property is a function, that function gets called and
|
||||
-- function's return value is used for the property.</p>
|
||||
--
|
||||
-- <p> To match multiple clients to a rule one need to use slightly different
|
||||
-- syntax:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule_any = { class = { "MPlayer", "Nitrogen" }, instance = { "xterm" } },
|
||||
-- properties = { floating = true } }
|
||||
-- </code>
|
||||
-- </p>
|
||||
--
|
||||
-- <p> To match multiple clients with an exception one can couple 'except' or
|
||||
-- 'except_any' with the rules:
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = { class = "Firefox" },
|
||||
-- except = { instance = "Navigator" },
|
||||
-- properties = {floating = true},
|
||||
-- },
|
||||
-- </code>
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule_any = { class = { "Pidgin", "Xchat" } },
|
||||
-- except_any = { role = { "conversation" } },
|
||||
-- properties = { tag = tags[1][1] }
|
||||
-- }
|
||||
-- <br/>
|
||||
-- <code>
|
||||
-- { rule = {},
|
||||
-- except_any = { class = { "Firefox", "Vim" } },
|
||||
-- properties = { floating = true }
|
||||
-- }
|
||||
-- </code>
|
||||
-- </p>
|
||||
--
|
||||
-- @class table
|
||||
-- @name rules
|
||||
--[[--
|
||||
This is the global rules table.
|
||||
|
||||
You should fill this table with your rule and properties to apply.
|
||||
For example, if you want to set xterm maximized at startup, you can add:
|
||||
|
||||
{ rule = { class = "xterm" },
|
||||
properties = { maximized_vertical = true, maximized_horizontal = true } }
|
||||
|
||||
If you want to set mplayer floating at startup, you can add:
|
||||
|
||||
{ rule = { name = "MPlayer" },
|
||||
properties = { floating = true } }
|
||||
|
||||
If you want to put Firefox on a specific tag at startup, you can add:
|
||||
|
||||
{ rule = { instance = "firefox" },
|
||||
properties = { tag = mytagobject } }
|
||||
|
||||
If you want to put Emacs on a specific tag at startup, and immediately switch
|
||||
to that tag you can add:
|
||||
|
||||
{ rule = { class = "Emacs" },
|
||||
properties = { tag = mytagobject, switchtotag = true } }
|
||||
|
||||
If you want to apply a custom callback to execute when a rule matched,
|
||||
for example to pause playing music from mpd when you start dosbox, you
|
||||
can add:
|
||||
|
||||
{ rule = { class = "dosbox" },
|
||||
callback = function(c)
|
||||
awful.util.spawn('mpc pause')
|
||||
end }
|
||||
|
||||
Note that all "rule" entries need to match. If any of the entry does not
|
||||
match, the rule won't be applied.
|
||||
|
||||
If a client matches multiple rules, their applied in the order they are
|
||||
put in this global rules table. If the value of a rule is a string, then the
|
||||
match function is used to determine if the client matches the rule.
|
||||
|
||||
If the value of a property is a function, that function gets called and
|
||||
function's return value is used for the property.
|
||||
|
||||
To match multiple clients to a rule one need to use slightly different
|
||||
syntax:
|
||||
|
||||
{ rule_any = { class = { "MPlayer", "Nitrogen" }, instance = { "xterm" } },
|
||||
properties = { floating = true } }
|
||||
|
||||
To match multiple clients with an exception one can couple `rules.except` or
|
||||
`rules.except_any` with the rules:
|
||||
|
||||
{ rule = { class = "Firefox" },
|
||||
except = { instance = "Navigator" },
|
||||
properties = {floating = true},
|
||||
},
|
||||
|
||||
{ rule_any = { class = { "Pidgin", "Xchat" } },
|
||||
except_any = { role = { "conversation" } },
|
||||
properties = { tag = tags[1][1] }
|
||||
}
|
||||
|
||||
{ rule = {},
|
||||
except_any = { class = { "Firefox", "Vim" } },
|
||||
properties = { floating = true }
|
||||
}
|
||||
]]--
|
||||
rules.rules = {}
|
||||
|
||||
--- Check if a client matches a rule.
|
||||
-- @client c The client.
|
||||
-- @tab rule The rule to check.
|
||||
-- @return True if it matches, false otherwise.
|
||||
-- @treturn bool True if it matches, false otherwise.
|
||||
function rules.match(c, rule)
|
||||
if not rule then return false end
|
||||
for field, value in pairs(rule) do
|
||||
|
@ -130,7 +113,7 @@ end
|
|||
--- Check if a client matches any part of a rule.
|
||||
-- @client c The client.
|
||||
-- @tab rule The rule to check.
|
||||
-- @return True if at least one rule is matched, false otherwise.
|
||||
-- @treturn bool True if at least one rule is matched, false otherwise.
|
||||
function rules.match_any(c, rule)
|
||||
if not rule then return false end
|
||||
for field, values in pairs(rule) do
|
||||
|
@ -166,8 +149,8 @@ end
|
|||
--- Check if a client matches a given set of rules.
|
||||
-- @client c The client.
|
||||
-- @tab rules The rules to check. List with "rule", "rule_any", "except" and
|
||||
-- "except_any" keys.
|
||||
-- @treturn boolean True if at least one rule is matched, false otherwise.
|
||||
-- "except_any" keys.
|
||||
-- @treturn bool True if at least one rule is matched, false otherwise.
|
||||
function rules.does_match(c, rules)
|
||||
local result = rules.matching_rules(c, rules)
|
||||
return #result == 0 and false or result
|
||||
|
@ -197,7 +180,7 @@ end
|
|||
--- Apply properties and callbacks to a client.
|
||||
-- @client c The client.
|
||||
-- @tab props Properties to apply.
|
||||
-- @tab callbacks Callbacks to apply (optional).
|
||||
-- @tab[opt] callbacks Callbacks to apply.
|
||||
function rules.execute(c, props, callbacks)
|
||||
for property, value in pairs(props) do
|
||||
if property ~= "focus" and type(value) == "function" then
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Screen module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.screen
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -16,8 +19,6 @@ local util = require("awful.util")
|
|||
-- we use require("awful.client") inside functions to prevent circular dependencies.
|
||||
local client
|
||||
|
||||
--- Screen module for awful
|
||||
-- awful.screen
|
||||
local screen = {}
|
||||
|
||||
local data = {}
|
||||
|
@ -29,7 +30,7 @@ data.padding = {}
|
|||
-- `screen` table/object.
|
||||
-- @param x The x coordinate
|
||||
-- @param y The y coordinate
|
||||
-- @param default Optional default return value. If unspecified, 1 is returned.
|
||||
-- @param[opt] default The default return value. If unspecified, 1 is returned.
|
||||
function screen.getbycoord(x, y, default)
|
||||
for i = 1, capi.screen:count() do
|
||||
local geometry = capi.screen[i].geometry
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Startup notification module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.startup_notification
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -13,9 +16,6 @@ local capi =
|
|||
root = root
|
||||
}
|
||||
|
||||
--- Startup notification module for awful
|
||||
-- awful.startup_notification
|
||||
|
||||
local app_starting = {}
|
||||
|
||||
local cursor_waiting = "watch"
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Useful functions for tag manipulation.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.tag
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -21,8 +24,6 @@ local capi =
|
|||
root = root
|
||||
}
|
||||
|
||||
--- Useful functions for tag manipulation.
|
||||
-- awful.tag
|
||||
local tag = { mt = {} }
|
||||
|
||||
-- Private data
|
||||
|
@ -376,7 +377,7 @@ function tag.incmwfact(add, t)
|
|||
end
|
||||
|
||||
--- Get master width factor.
|
||||
-- @param t Optional tag.
|
||||
-- @param[opt] t The tag.
|
||||
function tag.getmwfact(t)
|
||||
local t = t or tag.selected()
|
||||
return tag.getproperty(t, "mwfact") or 0.5
|
||||
|
@ -384,7 +385,7 @@ end
|
|||
|
||||
--- Set the number of master windows.
|
||||
-- @param nmaster The number of master windows.
|
||||
-- @param t Optional tag.
|
||||
-- @param[opt] t The tag.
|
||||
function tag.setnmaster(nmaster, t)
|
||||
local t = t or tag.selected()
|
||||
if nmaster >= 0 then
|
||||
|
@ -393,7 +394,7 @@ function tag.setnmaster(nmaster, t)
|
|||
end
|
||||
|
||||
--- Get the number of master windows.
|
||||
-- @param t Optional tag.
|
||||
-- @param[opt] t The tag.
|
||||
function tag.getnmaster(t)
|
||||
local t = t or tag.selected()
|
||||
return tag.getproperty(t, "nmaster") or 1
|
||||
|
@ -433,7 +434,7 @@ function tag.setncol(ncol, t)
|
|||
end
|
||||
|
||||
--- Get number of column windows.
|
||||
-- @param t Optional tag.
|
||||
-- @param[opt] t The tag.
|
||||
function tag.getncol(t)
|
||||
local t = t or tag.selected()
|
||||
return tag.getproperty(t, "ncol") or 1
|
||||
|
@ -447,7 +448,7 @@ function tag.incncol(add, t)
|
|||
end
|
||||
|
||||
--- View no tag.
|
||||
-- @param Optional screen number.
|
||||
-- @tparam[opt] int screen The screen number.
|
||||
function tag.viewnone(screen)
|
||||
local tags = tag.gettags(screen or capi.mouse.screen)
|
||||
for i, t in pairs(tags) do
|
||||
|
@ -457,7 +458,7 @@ end
|
|||
|
||||
--- View a tag by its taglist index.
|
||||
-- @param i The relative index to see.
|
||||
-- @param screen Optional screen number.
|
||||
-- @param[opt] screen The screen number.
|
||||
function tag.viewidx(i, screen)
|
||||
local screen = screen or capi.mouse.screen
|
||||
local tags = tag.gettags(screen)
|
||||
|
@ -522,7 +523,7 @@ end
|
|||
|
||||
--- View only a set of tags.
|
||||
-- @param tags A table with tags to view only.
|
||||
-- @param screen Optional screen number of the tags.
|
||||
-- @param[opt] screen The screen number of the tags.
|
||||
function tag.viewmore(tags, screen)
|
||||
local screen = screen or capi.mouse.screen
|
||||
local screen_tags = tag.gettags(screen)
|
||||
|
@ -538,22 +539,22 @@ function tag.viewmore(tags, screen)
|
|||
end
|
||||
|
||||
--- Toggle selection of a tag
|
||||
-- @param tag Tag to be toggled
|
||||
-- @tparam tag t Tag to be toggled
|
||||
function tag.viewtoggle(t)
|
||||
t.selected = not t.selected
|
||||
capi.screen[tag.getscreen(t)]:emit_signal("tag::history::update")
|
||||
end
|
||||
|
||||
--- Get tag data table.
|
||||
-- @param tag The Tag.
|
||||
-- @tparam tag _tag The tag.
|
||||
-- @return The data table.
|
||||
function tag.getdata(_tag)
|
||||
return data.tags[_tag]
|
||||
end
|
||||
|
||||
--- Get a tag property.
|
||||
-- @param _tag The tag.
|
||||
-- @param prop The property name.
|
||||
-- @tparam tag _tag The tag.
|
||||
-- @tparam string prop The property name.
|
||||
-- @return The property.
|
||||
function tag.getproperty(_tag, prop)
|
||||
if data.tags[_tag] then
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Titlebars for awful.
|
||||
--
|
||||
-- @author Uli Schlachter
|
||||
-- @copyright 2012 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.titlebar
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local error = error
|
||||
|
@ -52,7 +55,7 @@ end
|
|||
--- Get a client's titlebar
|
||||
-- @class function
|
||||
-- @param c The client for which a titlebar is wanted.
|
||||
-- @param args An optional table with extra arguments for the titlebar. The
|
||||
-- @param[opt] args A table with extra arguments for the titlebar. The
|
||||
-- "size" is the height of the titlebar. Available "position" values are top,
|
||||
-- left, right and bottom. Additionally, the foreground and background colors
|
||||
-- can be configured via e.g. "bg_normal" and "bg_focus".
|
||||
|
@ -101,7 +104,7 @@ end
|
|||
|
||||
--- Show a client's titlebar.
|
||||
-- @param c The client whose titlebar is modified
|
||||
-- @param position Optional position of the titlebar. Must be one of "left",
|
||||
-- @param[opt] position The position of the titlebar. Must be one of "left",
|
||||
-- "right", "top", "bottom". Default is "top".
|
||||
function titlebar.show(c, position)
|
||||
local position = position or "top"
|
||||
|
@ -113,7 +116,7 @@ end
|
|||
|
||||
--- Hide a client's titlebar.
|
||||
-- @param c The client whose titlebar is modified
|
||||
-- @param position Optional position of the titlebar. Must be one of "left",
|
||||
-- @param[opt] position The position of the titlebar. Must be one of "left",
|
||||
-- "right", "top", "bottom". Default is "top".
|
||||
function titlebar.hide(c, position)
|
||||
local position = position or "top"
|
||||
|
@ -122,7 +125,7 @@ end
|
|||
|
||||
--- Toggle a client's titlebar, hiding it if it is visible, otherwise showing it.
|
||||
-- @param c The client whose titlebar is modified
|
||||
-- @param position Optional position of the titlebar. Must be one of "left",
|
||||
-- @param[opt] position The position of the titlebar. Must be one of "left",
|
||||
-- "right", "top", "bottom". Default is "top".
|
||||
function titlebar.toggle(c, position)
|
||||
local position = position or "top"
|
||||
|
|
|
@ -1,40 +1,43 @@
|
|||
-------------------------------------------------------------------------
|
||||
--- Tooltip module for awesome objects.
|
||||
--
|
||||
-- A tooltip is a small hint displayed when the mouse cursor
|
||||
-- hovers a specific item.
|
||||
-- In awesome, a tooltip can be linked with almost any
|
||||
-- object having a <code>connect_signal()</code> method and receiving
|
||||
-- <code>mouse::enter</code> and <code>mouse::leave</code> signals.
|
||||
-- <p>How to create a tooltip?<br/>
|
||||
-- <code>
|
||||
-- myclock = awful.widget.textclock({}, "%T", 1)<br/>
|
||||
-- myclock_t = awful.tooltip({<br/>
|
||||
-- objects = { myclock },<br/>
|
||||
-- timer_function = function()<br/>
|
||||
-- return os.date("Today is %A %B %d %Y\nThe time is %T")<br/>
|
||||
-- end,<br/>
|
||||
-- })<br/>
|
||||
-- </code>
|
||||
-- </p>
|
||||
-- <p>How to add the same tooltip to several objects?<br/>
|
||||
-- <code>
|
||||
-- myclock_t:add_to_object(obj1)<br/>
|
||||
-- myclock_t:add_to_object(obj2)<br/>
|
||||
-- </code>
|
||||
-- Now the same tooltip is attached to <code>myclock</code>, <code>obj1</code>,
|
||||
-- <code>obj2</code>.<br/>
|
||||
-- </p>
|
||||
-- <p>How to remove tooltip from many objects?<br/>
|
||||
-- <code>
|
||||
-- myclock_t:remove_from_object(obj1)<br/>
|
||||
-- myclock_t:remove_from_object(obj2)<br/>
|
||||
-- </code>
|
||||
-- Now the same tooltip is only attached to <code>myclock</code>.<br/>
|
||||
-- </p>
|
||||
-- object having a `:connect_signal()` method and receiving
|
||||
-- `mouse::enter` and `mouse::leave` signals.
|
||||
--
|
||||
-- @author Sébastien Gross <seb•ɱɩɲʋʃ•awesome•ɑƬ•chezwam•ɖɵʈ•org>
|
||||
-- How to create a tooltip?
|
||||
-- ---
|
||||
--
|
||||
-- myclock = awful.widget.textclock({}, "%T", 1)
|
||||
-- myclock_t = awful.tooltip({
|
||||
-- objects = { myclock },
|
||||
-- timer_function = function()
|
||||
-- return os.date("Today is %A %B %d %Y\nThe time is %T")
|
||||
-- end,
|
||||
-- })
|
||||
--
|
||||
-- How to add the same tooltip to several objects?
|
||||
-- ---
|
||||
--
|
||||
-- myclock_t:add_to_object(obj1)
|
||||
-- myclock_t:add_to_object(obj2)
|
||||
--
|
||||
-- Now the same tooltip is attached to `myclock`, `obj1`, `obj2`.
|
||||
--
|
||||
-- How to remove tooltip from many objects?
|
||||
-- ---
|
||||
--
|
||||
-- myclock_t:remove_from_object(obj1)
|
||||
-- myclock_t:remove_from_object(obj2)
|
||||
--
|
||||
-- Now the same tooltip is only attached to `myclock`.
|
||||
--
|
||||
-- @author Sébastien Gross <seb•ɱɩɲʋʃ•awesome•ɑƬ•chezwam•ɖɵʈ•org>
|
||||
-- @copyright 2009 Sébastien Gross
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.tooltip
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
local mouse = mouse
|
||||
|
@ -73,6 +76,7 @@ local function place(self)
|
|||
end
|
||||
|
||||
-- Place the tooltip under the mouse.
|
||||
--
|
||||
-- @param self A tooltip object.
|
||||
local function set_geometry(self)
|
||||
local my_geo = self.wibox:geometry()
|
||||
|
@ -84,6 +88,7 @@ local function set_geometry(self)
|
|||
end
|
||||
|
||||
-- Show a tooltip.
|
||||
--
|
||||
-- @param self The tooltip to show.
|
||||
local function show(self)
|
||||
-- do nothing if the tooltip is already shown
|
||||
|
@ -101,6 +106,7 @@ local function show(self)
|
|||
end
|
||||
|
||||
-- Hide a tooltip.
|
||||
--
|
||||
-- @param self The tooltip to hide.
|
||||
local function hide(self)
|
||||
-- do nothing if the tooltip is already hidden
|
||||
|
@ -115,6 +121,7 @@ local function hide(self)
|
|||
end
|
||||
|
||||
--- Change displayed text.
|
||||
--
|
||||
-- @param self The tooltip object.
|
||||
-- @param text New tooltip text.
|
||||
tooltip.set_text = function(self, text)
|
||||
|
@ -123,6 +130,7 @@ tooltip.set_text = function(self, text)
|
|||
end
|
||||
|
||||
--- Change displayed text.
|
||||
--
|
||||
-- @param self The tooltip object.
|
||||
-- @param text New tooltip text, including pango markup.
|
||||
tooltip.set_markup = function(self, text)
|
||||
|
@ -131,6 +139,7 @@ tooltip.set_markup = function(self, text)
|
|||
end
|
||||
|
||||
--- Change the tooltip's update interval.
|
||||
--
|
||||
-- @param self A tooltip object.
|
||||
-- @param timeout The timeout value.
|
||||
-- @function set_timeout
|
||||
|
@ -141,6 +150,7 @@ tooltip.set_timeout = function(self, timeout)
|
|||
end
|
||||
|
||||
--- Add tooltip to an object.
|
||||
--
|
||||
-- @param self The tooltip.
|
||||
-- @param object An object.
|
||||
tooltip.add_to_object = function(self, object)
|
||||
|
@ -149,6 +159,7 @@ tooltip.add_to_object = function(self, object)
|
|||
end
|
||||
|
||||
--- Remove tooltip from an object.
|
||||
--
|
||||
-- @param self The tooltip.
|
||||
-- @param object An object.
|
||||
-- @function remove_from_object
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Utility module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.util
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -23,8 +26,6 @@ local capi =
|
|||
mouse = mouse
|
||||
}
|
||||
|
||||
--- Utility module for awful
|
||||
-- awful.util
|
||||
local util = {}
|
||||
util.table = {}
|
||||
|
||||
|
@ -32,7 +33,7 @@ util.shell = os.getenv("SHELL") or "/bin/sh"
|
|||
|
||||
local displayed_deprecations = {}
|
||||
--- Display a deprecation notice, but only once per traceback.
|
||||
-- @param see Optional message to a new method / function to use.
|
||||
-- @param[opt] see The message to a new method / function to use.
|
||||
function util.deprecate(see)
|
||||
local tb = debug.traceback()
|
||||
if displayed_deprecations[tb] then
|
||||
|
@ -184,12 +185,13 @@ function util.getdir(d)
|
|||
end
|
||||
|
||||
--- Search for an icon and return the full path.
|
||||
-- It searches for the icon path under the directories given w/the right ext
|
||||
-- It searches for the icon path under the given directories with respect to the
|
||||
-- given extensions for the icon filename.
|
||||
-- @param iconname The name of the icon to search for.
|
||||
-- @param exts Table of image extensions allowed, otherwise { 'png', gif' }
|
||||
-- @param dirs Table of dirs to search, otherwise { '/usr/share/pixmaps/' }
|
||||
-- @param size Optional size. If this is specified, subdirectories <size>x<size>
|
||||
-- of the dirs are searched first
|
||||
-- @tparam[opt] string size The size. If this is specified, subdirectories `x`
|
||||
-- of the dirs are searched first.
|
||||
function util.geticonpath(iconname, exts, dirs, size)
|
||||
local exts = exts or { 'png', 'gif' }
|
||||
local dirs = dirs or { '/usr/share/pixmaps/', '/usr/share/icons/hicolor/' }
|
||||
|
@ -276,7 +278,7 @@ function util.subsets(set)
|
|||
return ret
|
||||
end
|
||||
|
||||
-- Return true whether rectangle B is in the right direction
|
||||
--- Return true whether rectangle B is in the right direction
|
||||
-- compared to rectangle A.
|
||||
-- @param dir The direction.
|
||||
-- @param gA The geometric specification for rectangle A.
|
||||
|
@ -295,12 +297,12 @@ local function is_in_direction(dir, gA, gB)
|
|||
return false
|
||||
end
|
||||
|
||||
-- Calculate distance between two points.
|
||||
--- Calculate distance between two points.
|
||||
-- i.e: if we want to move to the right, we will take the right border
|
||||
-- of the currently focused screen and the left side of the checked screen.
|
||||
-- @param dir The direction.
|
||||
-- @param gA The first rectangle.
|
||||
-- @param gB The second rectangle.
|
||||
-- @param _gA The first rectangle.
|
||||
-- @param _gB The second rectangle.
|
||||
-- @return The distance between the screens.
|
||||
local function calculate_distance(dir, _gA, _gB)
|
||||
local gAx = _gA.x
|
||||
|
@ -321,7 +323,7 @@ local function calculate_distance(dir, _gA, _gB)
|
|||
return math.sqrt(math.pow(gBx - gAx, 2) + math.pow(gBy - gAy, 2))
|
||||
end
|
||||
|
||||
-- Get the nearest rectangle in the given direction. Every rectangle is specified as a table
|
||||
--- Get the nearest rectangle in the given direction. Every rectangle is specified as a table
|
||||
-- with 'x', 'y', 'width', 'height' keys, the same as client or screen geometries.
|
||||
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
||||
-- @param recttbl A table of rectangle specifications.
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Wibox module for awful.
|
||||
-- This module allows you to easily create wibox and attach them to the edge of
|
||||
-- a screen.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module awful.wibox
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -19,13 +24,9 @@ local error = error
|
|||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
--- Wibox module for awful.
|
||||
-- This module allows you to easily create wibox and attach them to the edge of
|
||||
-- a screen.
|
||||
-- awful.wibox
|
||||
local awfulwibox = { mt = {} }
|
||||
|
||||
-- Array of table with wiboxes inside.
|
||||
--- Array of table with wiboxes inside.
|
||||
-- It's an array so it is ordered.
|
||||
local wiboxes = {}
|
||||
|
||||
|
@ -70,7 +71,7 @@ function awfulwibox.set_position(wibox, position, screen)
|
|||
end
|
||||
end
|
||||
|
||||
-- Reset all wiboxes positions.
|
||||
--- Reset all wiboxes positions.
|
||||
local function update_all_wiboxes_position()
|
||||
for _, wprop in ipairs(wiboxes) do
|
||||
awfulwibox.set_position(wprop.wibox, wprop.position, wprop.screen)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.button
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -13,11 +14,11 @@ local surface = require("gears.surface")
|
|||
local cairo = require("lgi").cairo
|
||||
local capi = { mouse = mouse }
|
||||
|
||||
-- awful.widget.button
|
||||
local button = { mt = {} }
|
||||
|
||||
--- Create a button widget. When clicked, the image is deplaced to make it like
|
||||
-- a real button.
|
||||
--
|
||||
-- @param args Widget arguments. "image" is the image to display.
|
||||
-- @return A textbox widget configured as a button.
|
||||
function button.new(args)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.common
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -20,6 +21,10 @@ local textbox = require("wibox.widget.textbox")
|
|||
--- Common utilities for awful widgets
|
||||
local common = {}
|
||||
|
||||
--- Common method to create buttons.
|
||||
-- @tab buttons
|
||||
-- @param object
|
||||
-- @treturn table
|
||||
function common.create_buttons(buttons, object)
|
||||
if buttons then
|
||||
local btns = {}
|
||||
|
@ -38,6 +43,14 @@ function common.create_buttons(buttons, object)
|
|||
end
|
||||
end
|
||||
|
||||
--- Common update method.
|
||||
-- @param w The widget.
|
||||
-- @tab buttons
|
||||
-- @func label Function to generate label parameters from an object.
|
||||
-- The function gets passed an object from `objects`, and
|
||||
-- has to return `text`, `bg`, `bg_image`, `icon`.
|
||||
-- @tab data Current data/cache, indexed by objects.
|
||||
-- @tab objects Objects to be displayed / updated.
|
||||
function common.list_update(w, buttons, label, data, objects)
|
||||
-- update the widgets, creating them if needed
|
||||
w:reset()
|
||||
|
@ -75,7 +88,7 @@ function common.list_update(w, buttons, label, data, objects)
|
|||
end
|
||||
|
||||
local text, bg, bg_image, icon = label(o)
|
||||
-- The text might be invalid, so use pcall
|
||||
-- The text might be invalid, so use pcall.
|
||||
if text == nil or text == "" then
|
||||
m:set_margins(0)
|
||||
else
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- A graph widget.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.graph
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -12,54 +15,53 @@ local type = type
|
|||
local color = require("gears.color")
|
||||
local base = require("wibox.widget.base")
|
||||
|
||||
--- A graph widget.
|
||||
-- awful.widget.graph
|
||||
local graph = { mt = {} }
|
||||
|
||||
local data = setmetatable({}, { __mode = "k" })
|
||||
|
||||
--- Set the graph border color.
|
||||
-- If the value is nil, no border will be drawn.
|
||||
-- @name set_border_color
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_border_color
|
||||
-- @param graph The graph.
|
||||
-- @param color The border color to set.
|
||||
|
||||
--- Set the graph foreground color.
|
||||
-- @name set_color
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_color
|
||||
-- @param graph The graph.
|
||||
-- @param color The graph color.
|
||||
-- @see gears.color.create_pattern
|
||||
|
||||
--- Set the graph background color.
|
||||
-- @name set_background_color
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_background_color
|
||||
-- @param graph The graph.
|
||||
-- @param color The graph background color.
|
||||
|
||||
--- Set the maximum value the graph should handle.
|
||||
-- If "scale" is also set, the graph never scales up below this value, but it
|
||||
-- automatically scales down to make all data fit.
|
||||
-- @name set_max_value
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_max_value
|
||||
-- @param graph The graph.
|
||||
-- @param value The value.
|
||||
|
||||
--- Set the graph to automatically scale its values. Default is false.
|
||||
-- @name set_scale
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_scale
|
||||
-- @param graph The graph.
|
||||
-- @param scale A boolean value
|
||||
|
||||
--- Set the graph to draw stacks. Default is false.
|
||||
-- @name set_stack
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_stack
|
||||
-- @param graph The graph.
|
||||
-- @param stack A boolean value.
|
||||
|
||||
--- Set the graph stacking colors. Order matters.
|
||||
-- @name set_stack_colors
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_stack_colors
|
||||
-- @param graph The graph.
|
||||
-- @param stack_colors A table with stacking colors.
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Widget module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- Widget module for awful
|
||||
-- awful.widget
|
||||
|
||||
return
|
||||
{
|
||||
taglist = require("awful.widget.taglist");
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.launcher
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -9,7 +10,6 @@ local util = require("awful.util")
|
|||
local wbutton = require("awful.widget.button")
|
||||
local button = require("awful.button")
|
||||
|
||||
-- awful.widget.launcher
|
||||
local launcher = { mt = {} }
|
||||
|
||||
--- Create a button widget which will launch a command.
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Layoutbox widget.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.layoutbox
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -12,8 +15,6 @@ local tag = require("awful.tag")
|
|||
local beautiful = require("beautiful")
|
||||
local imagebox = require("wibox.widget.imagebox")
|
||||
|
||||
--- Layoutbox widget.
|
||||
-- awful.widget.layoutbox
|
||||
local layoutbox = { mt = {} }
|
||||
|
||||
local function update(w, screen)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- A progressbar widget.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.progressbar
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -10,58 +13,56 @@ local math = math
|
|||
local base = require("wibox.widget.base")
|
||||
local color = require("gears.color")
|
||||
|
||||
--- A progressbar widget.
|
||||
-- awful.widget.progressbar
|
||||
local progressbar = { mt = {} }
|
||||
|
||||
local data = setmetatable({}, { __mode = "k" })
|
||||
|
||||
--- Set the progressbar border color.
|
||||
-- If the value is nil, no border will be drawn.
|
||||
-- @name set_border_color
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_border_color
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param color The border color to set.
|
||||
|
||||
--- Set the progressbar foreground color.
|
||||
-- @name set_color
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_color
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param color The progressbar color.
|
||||
|
||||
--- Set the progressbar background color.
|
||||
-- @name set_background_color
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_background_color
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param color The progressbar background color.
|
||||
|
||||
--- Set the progressbar to draw vertically. Default is false.
|
||||
-- @name set_vertical
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_vertical
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param vertical A boolean value.
|
||||
|
||||
--- Set the progressbar to draw ticks. Default is false.
|
||||
-- @name set_ticks
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_ticks
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param ticks A boolean value.
|
||||
|
||||
--- Set the progressbar ticks gap.
|
||||
-- @name set_ticks_gap
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_ticks_gap
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param value The value.
|
||||
|
||||
--- Set the progressbar ticks size.
|
||||
-- @name set_ticks_size
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_ticks_size
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param value The value.
|
||||
|
||||
--- Set the maximum value the progressbar should handle.
|
||||
-- @name set_max_value
|
||||
-- @class function
|
||||
--
|
||||
-- @function set_max_value
|
||||
-- @param progressbar The progressbar.
|
||||
-- @param value The value.
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.prompt
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -13,10 +14,10 @@ local widget_base = require("wibox.widget.base")
|
|||
local textbox = require("wibox.widget.textbox")
|
||||
local type = type
|
||||
|
||||
-- awful.widget.prompt
|
||||
local widgetprompt = { mt = {} }
|
||||
|
||||
--- Run method for promptbox.
|
||||
--
|
||||
-- @param promptbox The promptbox to run.
|
||||
local function run(promptbox)
|
||||
return prompt.run({ prompt = promptbox.prompt },
|
||||
|
@ -32,6 +33,7 @@ local function run(promptbox)
|
|||
end
|
||||
|
||||
--- Create a prompt widget which will launch a command.
|
||||
--
|
||||
-- @param args Arguments table. "prompt" is the prompt to use.
|
||||
-- @return A launcher widget.
|
||||
function widgetprompt.new(args)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Taglist widget module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.taglist
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -20,8 +23,6 @@ local beautiful = require("beautiful")
|
|||
local fixed = require("wibox.layout.fixed")
|
||||
local surface = require("gears.surface")
|
||||
|
||||
--- Taglist widget module for awful
|
||||
-- awful.widget.taglist
|
||||
local taglist = { mt = {} }
|
||||
taglist.filter = {}
|
||||
|
||||
|
@ -138,20 +139,20 @@ end
|
|||
-- @param filter Filter function to define what clients will be listed.
|
||||
-- @param buttons A table with buttons binding to set.
|
||||
-- @param style The style overrides default theme.
|
||||
-- @param update_function Optional function to create a tag widget on each
|
||||
-- @param[opt] update_function Function to create a tag widget on each
|
||||
-- update. @see awful.widget.common.
|
||||
-- @param base_widget Optional container widget for tag widgets. Default
|
||||
-- @param[opt] base_widget Optional container widget for tag widgets. Default
|
||||
-- is wibox.layout.fixed.horizontal().
|
||||
-- bg_focus The background color for focused client.
|
||||
-- fg_focus The foreground color for focused client.
|
||||
-- bg_urgent The background color for urgent clients.
|
||||
-- fg_urgent The foreground color for urgent clients.
|
||||
-- squares_sel Optional: a user provided image for selected squares.
|
||||
-- squares_unsel Optional: a user provided image for unselected squares.
|
||||
-- squares_sel_empty Optional: a user provided image for selected squares for empty tags.
|
||||
-- squares_unsel_empty Optional: a user provided image for unselected squares for empty tags.
|
||||
-- squares_resize Optional: true or false to resize squares.
|
||||
-- font The font.
|
||||
-- @param base_widget.bg_focus The background color for focused client.
|
||||
-- @param base_widget.fg_focus The foreground color for focused client.
|
||||
-- @param base_widget.bg_urgent The background color for urgent clients.
|
||||
-- @param base_widget.fg_urgent The foreground color for urgent clients.
|
||||
-- @param[opt] base_widget.squares_sel A user provided image for selected squares.
|
||||
-- @param[opt] base_widget.squares_unsel A user provided image for unselected squares.
|
||||
-- @param[opt] base_widget.squares_sel_empty A user provided image for selected squares for empty tags.
|
||||
-- @param[opt] base_widget.squares_unsel_empty A user provided image for unselected squares for empty tags.
|
||||
-- @param[opt] base_widget.squares_resize True or false to resize squares.
|
||||
-- @param base_widget.font The font.
|
||||
function taglist.new(screen, filter, buttons, style, update_function, base_widget)
|
||||
local uf = update_function or common.list_update
|
||||
local w = base_widget or fixed.horizontal()
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Tasklist widget module for awful
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.tasklist
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -17,8 +20,6 @@ local util = require("awful.util")
|
|||
local tag = require("awful.tag")
|
||||
local flex = require("wibox.layout.flex")
|
||||
|
||||
--- Tasklist widget module for awful
|
||||
-- awful.widget.tasklist
|
||||
local tasklist = { mt = {} }
|
||||
|
||||
-- Public structures
|
||||
|
@ -121,26 +122,25 @@ end
|
|||
-- @param filter Filter function to define what clients will be listed.
|
||||
-- @param buttons A table with buttons binding to set.
|
||||
-- @param style The style overrides default theme.
|
||||
-- @param update_function Optional function to create a tag widget on each
|
||||
-- update. @see awful.widget.common.
|
||||
-- @param base_widget Optional container widget for tag widgets. Default
|
||||
-- is wibox.layout.flex.horizontal().
|
||||
-- <ul>
|
||||
-- <li><code>bg_normal</code> The background color for unfocused client.</li>
|
||||
-- <li><code>fg_normal</code> The foreground color for unfocused client.</li>
|
||||
-- <li><code>bg_focus</code> The background color for focused client.</li>
|
||||
-- <li><code>fg_focus</code> The foreground color for focused client.</li>
|
||||
-- <li><code>bg_urgent</code> The background color for urgent clients.</li>
|
||||
-- <li><code>fg_urgent</code> The foreground color for urgent clients.</li>
|
||||
-- <li><code>bg_minimize</code> The background color for minimized clients.</li>
|
||||
-- <li><code>fg_minimize</code> The foreground color for minimized clients.</li>
|
||||
-- <li><code>floating</code> Symbol to use for floating clients.</li>
|
||||
-- <li><code>ontop</code> Symbol to use for ontop clients.</li>
|
||||
-- <li><code>maximized</code> Symbol to use for clients that have been maximized (vertically and horizontally).</li>
|
||||
-- <li><code>maximized_horizontal</code> Symbol to use for clients that have been horizontally maximized.</li>
|
||||
-- <li><code>maximized_vertical</code> Symbol to use for clients that have been vertically maximized.</li>
|
||||
-- <li><code>font</code> The font.</li>
|
||||
-- </ul>
|
||||
-- @param[opt] update_function Function to create a tag widget on each
|
||||
-- update. See `awful.widget.common.list_update`.
|
||||
-- @tparam[opt] table base_widget Container widget for tag widgets. Default
|
||||
-- is `wibox.layout.flex.horizontal`.
|
||||
-- @param base_widget.bg_normal The background color for unfocused client.
|
||||
-- @param base_widget.bg_normal The background color for unfocused client.
|
||||
-- @param base_widget.fg_normal The foreground color for unfocused client.
|
||||
-- @param base_widget.bg_focus The background color for focused client.
|
||||
-- @param base_widget.fg_focus The foreground color for focused client.
|
||||
-- @param base_widget.bg_urgent The background color for urgent clients.
|
||||
-- @param base_widget.fg_urgent The foreground color for urgent clients.
|
||||
-- @param base_widget.bg_minimize The background color for minimized clients.
|
||||
-- @param base_widget.fg_minimize The foreground color for minimized clients.
|
||||
-- @param base_widget.floating Symbol to use for floating clients.
|
||||
-- @param base_widget.ontop Symbol to use for ontop clients.
|
||||
-- @param base_widget.maximized Symbol to use for clients that have been maximized (vertically and horizontally).
|
||||
-- @param base_widget.maximized_horizontal Symbol to use for clients that have been horizontally maximized.
|
||||
-- @param base_widget.maximized_vertical Symbol to use for clients that have been vertically maximized.
|
||||
-- @param base_widget.font The font.
|
||||
function tasklist.new(screen, filter, buttons, style, update_function, base_widget)
|
||||
local uf = update_function or common.list_update
|
||||
local w = base_widget or flex.horizontal()
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Text clock widget.
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod awful.widget.textclock
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -9,17 +12,16 @@ local os = os
|
|||
local textbox = require("wibox.widget.textbox")
|
||||
local timer = require("gears.timer")
|
||||
|
||||
--- Text clock widget.
|
||||
-- awful.widget.textclock
|
||||
local textclock = { mt = {} }
|
||||
|
||||
-- This lowers the timeout so that it occurs "correctly". For example, a timeout
|
||||
--- This lowers the timeout so that it occurs "correctly". For example, a timeout
|
||||
-- of 60 is rounded so that it occurs the next time the clock reads ":00 seconds".
|
||||
local function calc_timeout(real_timeout)
|
||||
return real_timeout - os.time() % real_timeout
|
||||
end
|
||||
|
||||
--- Create a textclock widget. It draws the time it is in a textbox.
|
||||
--
|
||||
-- @param format The time format. Default is " %a %b %d, %H:%M ".
|
||||
-- @param timeout How often update the time. Default is 60.
|
||||
-- @return A textbox widget.
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
----------------------------------------------------------------------------
|
||||
--- Theme library.
|
||||
--
|
||||
-- @author Damien Leone <damien.leone@gmail.com>
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2008-2009 Damien Leone, Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module beautiful
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment
|
||||
|
@ -24,7 +27,6 @@ local capi =
|
|||
awesome = awesome
|
||||
}
|
||||
|
||||
--- Theme library.
|
||||
local beautiful = { mt = {} }
|
||||
|
||||
-- Local data
|
||||
|
@ -33,6 +35,9 @@ local descs = setmetatable({}, { __mode = 'k' })
|
|||
local fonts = setmetatable({}, { __mode = 'v' })
|
||||
local active_font
|
||||
|
||||
--- Load a font name
|
||||
--
|
||||
-- @param name Font name, which can be a string or a table
|
||||
local function load_font(name)
|
||||
name = name or active_font
|
||||
if name and type(name) ~= "string" and descs[name] then
|
||||
|
@ -59,21 +64,31 @@ local function load_font(name)
|
|||
return font
|
||||
end
|
||||
|
||||
--- Set an active font
|
||||
--
|
||||
-- @param name The font
|
||||
local function set_font(name)
|
||||
active_font = load_font(name).name
|
||||
end
|
||||
|
||||
--- Get a font description
|
||||
--
|
||||
-- @param name The name of the font
|
||||
function beautiful.get_font(name)
|
||||
return load_font(name).description
|
||||
end
|
||||
|
||||
--- Get the heigh of a font
|
||||
--
|
||||
-- @param name Name of the font
|
||||
function beautiful.get_font_height(name)
|
||||
return load_font(name).height
|
||||
end
|
||||
|
||||
--- Init function, should be runned at the beginning of configuration file.
|
||||
-- @param config The theme to load. It can be either the path to the theme file
|
||||
-- (returning a table) or directly the table containing all the theme values
|
||||
-- @tparam string|table config The theme to load. It can be either the path to
|
||||
-- the theme file (returning a table) or directly the table
|
||||
-- containing all the theme values.
|
||||
function beautiful.init(config)
|
||||
if config then
|
||||
local success
|
||||
|
@ -111,7 +126,8 @@ function beautiful.init(config)
|
|||
end
|
||||
|
||||
--- Get the current theme.
|
||||
-- @return The current theme table.
|
||||
--
|
||||
-- @treturn table The current theme table.
|
||||
function beautiful.get()
|
||||
return theme
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears.color
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -19,11 +20,13 @@ local color = { mt = {} }
|
|||
local pattern_cache = setmetatable({}, { __mode = 'v' })
|
||||
|
||||
--- Parse a HTML-color.
|
||||
-- This function can parse colors like #rrggbb and #rrggbbaa.
|
||||
-- For example, parse_color("#00ff00ff") would return 0, 1, 0, 1.
|
||||
-- This function can parse colors like `#rrggbb` and `#rrggbbaa`.
|
||||
-- Thanks to #lua for this. :)
|
||||
--
|
||||
-- @param col The color to parse
|
||||
-- @return 4 values which each are in the range [0, 1].
|
||||
-- @usage -- This will return 0, 1, 0, 1
|
||||
-- gears.color.parse_color("#00ff00ff")
|
||||
function color.parse_color(col)
|
||||
local rgb = {}
|
||||
for pair in string.gmatch(col, "[^#].") do
|
||||
|
@ -39,7 +42,8 @@ function color.parse_color(col)
|
|||
end
|
||||
|
||||
--- Find all numbers in a string
|
||||
-- @param s The string to parse
|
||||
--
|
||||
-- @tparam string s The string to parse
|
||||
-- @return Each number found as a separate value
|
||||
local function parse_numbers(s)
|
||||
local res = {}
|
||||
|
@ -50,6 +54,7 @@ local function parse_numbers(s)
|
|||
end
|
||||
|
||||
--- Create a solid pattern
|
||||
--
|
||||
-- @param col The color for the pattern
|
||||
-- @return A cairo pattern object
|
||||
function color.create_solid_pattern(col)
|
||||
|
@ -63,6 +68,7 @@ function color.create_solid_pattern(col)
|
|||
end
|
||||
|
||||
--- Create an image pattern from a png file
|
||||
--
|
||||
-- @param file The filename of the file
|
||||
-- @return a cairo pattern object
|
||||
function color.create_png_pattern(file)
|
||||
|
@ -76,10 +82,10 @@ function color.create_png_pattern(file)
|
|||
return pattern
|
||||
end
|
||||
|
||||
-- Add stops to the given pattern.
|
||||
--- Add stops to the given pattern.
|
||||
-- @param p The cairo pattern to add stops to
|
||||
-- @param iterator An iterator that returns strings. Each of those strings
|
||||
-- should be in the form place,color where place is in [0, 1].
|
||||
-- should be in the form place,color where place is in [0, 1].
|
||||
local function add_iterator_stops(p, iterator)
|
||||
for k in iterator do
|
||||
local sub = string.gmatch(k, "[^,]+")
|
||||
|
@ -88,14 +94,14 @@ local function add_iterator_stops(p, iterator)
|
|||
end
|
||||
end
|
||||
|
||||
-- Add a list of stops to a given pattern
|
||||
--- Add a list of stops to a given pattern
|
||||
local function add_stops_table(pat, arg)
|
||||
for _, stop in ipairs(arg) do
|
||||
pat:add_color_stop_rgba(stop[1], color.parse_color(stop[2]))
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a pattern from a string
|
||||
--- Create a pattern from a string
|
||||
local function string_pattern(creator, arg)
|
||||
local iterator = string.gmatch(arg, "[^:]+")
|
||||
-- Create a table where each entry is a number from the original string
|
||||
|
@ -114,13 +120,13 @@ end
|
|||
|
||||
--- Create a linear pattern object.
|
||||
-- The pattern is created from a string. This string should have the following
|
||||
-- form: "x0,y0:x1,y1:<stops>"
|
||||
-- form: `"x0, y0:x1, y1:<stops>"`
|
||||
-- Alternatively, the pattern can be specified as a table:
|
||||
-- { type = "linear", from = { x0, y0 }, to = { x1, y1 },
|
||||
-- stops = { <stops> } }
|
||||
-- x0,y0 and x1,y1 are the start and stop point of the pattern.
|
||||
-- For the explanation of "<stops>", see @{create_pattern}.
|
||||
-- @param arg The argument describing the pattern
|
||||
-- { type = "linear", from = { x0, y0 }, to = { x1, y1 },
|
||||
-- stops = { <stops> } }
|
||||
-- `x0,y0` and `x1,y1` are the start and stop point of the pattern.
|
||||
-- For the explanation of `<stops>`, see `color.create_pattern`.
|
||||
-- @tparam string|table arg The argument describing the pattern.
|
||||
-- @return a cairo pattern object
|
||||
function color.create_linear_pattern(arg)
|
||||
local pat
|
||||
|
@ -138,14 +144,14 @@ end
|
|||
|
||||
--- Create a radial pattern object.
|
||||
-- The pattern is created from a string. This string should have the following
|
||||
-- form: "x0,y0,r0:x1,y1,r1:<stops>"
|
||||
-- form: `"x0, y0, r0:x1, y1, r1:<stops>"`
|
||||
-- Alternatively, the pattern can be specified as a table:
|
||||
-- { type = "radial", from = { x0, y0, r0 }, to = { x1, y1, r1 },
|
||||
-- stops = { <stops> } }
|
||||
-- x0,y0 and x1,y1 are the start and stop point of the pattern.
|
||||
-- r0 and r1 are the radii of the start / stop circle.
|
||||
-- For the explanation of "<stops>", see @{create_pattern}.
|
||||
-- @param arg The argument describing the pattern
|
||||
-- { type = "radial", from = { x0, y0, r0 }, to = { x1, y1, r1 },
|
||||
-- stops = { <stops> } }
|
||||
-- `x0,y0` and `x1,y1` are the start and stop point of the pattern.
|
||||
-- `r0` and `r1` are the radii of the start / stop circle.
|
||||
-- For the explanation of `<stops>`, see `color.create_pattern`.
|
||||
-- @tparam string|table arg The argument describing the pattern
|
||||
-- @return a cairo pattern object
|
||||
function color.create_radial_pattern(arg)
|
||||
local pat
|
||||
|
@ -171,10 +177,11 @@ color.types = {
|
|||
}
|
||||
|
||||
--- Create a pattern from a given string.
|
||||
-- For full documentation of this function, please refer to create_pattern().
|
||||
-- This difference between @{create_pattern} and this function is that this
|
||||
-- function does not insert the generated objects into the pattern cache. Thus,
|
||||
-- you are allowed to modify the returned object.
|
||||
-- For full documentation of this function, please refer to
|
||||
-- `color.create_pattern`. The difference between `color.create_pattern`
|
||||
-- and this function is that this function does not insert the generated
|
||||
-- objects into the pattern cache. Thus, you are allowed to modify the
|
||||
-- returned object.
|
||||
-- @see create_pattern
|
||||
-- @param col The string describing the pattern.
|
||||
-- @return a cairo pattern object
|
||||
|
@ -236,7 +243,7 @@ end
|
|||
--- Check if a pattern is opaque.
|
||||
-- A pattern is transparent if the background on which it gets drawn (with
|
||||
-- operator OVER) doesn't influence the visual result.
|
||||
-- @param col An argument that @{create_pattern} accepts
|
||||
-- @param col An argument that `create_pattern` accepts.
|
||||
-- @return The pattern if it is surely opaque, else nil
|
||||
function color.create_opaque_pattern(col)
|
||||
local pattern = color.create_pattern(col)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears.debug
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local error = error
|
||||
|
@ -11,12 +12,12 @@ local print = print
|
|||
local type = type
|
||||
local pairs = pairs
|
||||
|
||||
-- gears.debug
|
||||
local debug = {}
|
||||
|
||||
--- Check that the given condition holds true, else throw an error
|
||||
--
|
||||
-- @param cond If this is false, throw a lua error with a backtrace.
|
||||
-- @param message Message to print in the error (optional).
|
||||
-- @param[opt] message Message to print in the error.
|
||||
function debug.assert(cond, message)
|
||||
local message = message or cond
|
||||
if not cond then
|
||||
|
@ -24,7 +25,7 @@ function debug.assert(cond, message)
|
|||
end
|
||||
end
|
||||
|
||||
-- Given a table (or any other data) return a string that contains its
|
||||
--- Given a table (or any other data) return a string that contains its
|
||||
-- tag, value and type. If data is a table then recursively call d_raw
|
||||
-- on each of its values.
|
||||
-- @param data Value to inspect.
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- gears
|
||||
|
||||
return
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod gears.object
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -9,10 +10,9 @@ local pairs = pairs
|
|||
local type = type
|
||||
local error = error
|
||||
|
||||
-- gears.object
|
||||
local object = { mt = {} }
|
||||
|
||||
-- Verify that obj is indeed a valid object as returned by new()
|
||||
--- Verify that obj is indeed a valid object as returned by new()
|
||||
local function check(obj)
|
||||
if type(obj) ~= "table" or type(obj._signals) ~= "table" then
|
||||
error("add_signal() called on non-object")
|
||||
|
@ -60,10 +60,11 @@ function object:disconnect_signal(name, func)
|
|||
end
|
||||
|
||||
--- Emit a signal
|
||||
--
|
||||
-- @param name The name of the signal
|
||||
-- @param ... Extra arguments for the callback functions. Each connected
|
||||
-- function receives the object as first argument and then any extra
|
||||
-- arguments that are given to emit_signal()
|
||||
-- function receives the object as first argument and then any extra arguments
|
||||
-- that are given to emit_signal()
|
||||
function object:emit_signal(name, ...)
|
||||
local sig = find_signal(self, name, "emit")
|
||||
for func in pairs(sig) do
|
||||
|
@ -71,7 +72,7 @@ function object:emit_signal(name, ...)
|
|||
end
|
||||
end
|
||||
|
||||
-- Returns a new object. You can call :emit_signal(), :disconnect_signal,
|
||||
--- Returns a new object. You can call :emit_signal(), :disconnect_signal,
|
||||
-- :connect_signal() and :add_signal() on the resulting object.
|
||||
local function new()
|
||||
local ret = {}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears.sort
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -9,7 +10,6 @@ local ipairs = ipairs
|
|||
local table = table
|
||||
local error = error
|
||||
|
||||
-- gears.sort
|
||||
local sort = { mt = {} }
|
||||
|
||||
local function less_than_comp(a, b)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2012 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears.surface
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -15,7 +16,6 @@ if tonumber(ver_major) <= 0 and tonumber(ver_minor) < 7 then
|
|||
error("lgi too old, need at least version 0.7.0")
|
||||
end
|
||||
|
||||
-- gears.surface
|
||||
local surface = { mt = {} }
|
||||
local surface_cache = setmetatable({}, { __mode = 'v' })
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
--- Timer objects and functions.
|
||||
---------------------------------------------------------------------------
|
||||
--- Timer objects and functions.
|
||||
--
|
||||
-- @author Uli Schlachter
|
||||
-- @copyright 2014 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears.timer
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local capi = { awesome = awesome }
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2012 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module gears.wallpaper
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local cairo = require("lgi").cairo
|
||||
local color = require("gears.color")
|
||||
local surface = require("gears.surface")
|
||||
|
||||
-- gears.wallpaper
|
||||
local wallpaper = { mt = {} }
|
||||
|
||||
-- The size of the root window
|
||||
|
@ -30,8 +30,8 @@ end
|
|||
--- Prepare the needed state for setting a wallpaper
|
||||
-- @param s The screen to set the wallpaper on or nil for all screens
|
||||
-- @return The available geometry (table with entries width and height), a
|
||||
-- that should be used for setting the wallpaper and a cairo context
|
||||
-- for drawing to this surface
|
||||
-- that should be used for setting the wallpaper and a cairo context for
|
||||
-- drawing to this surface
|
||||
local function prepare_wallpaper(s)
|
||||
local geom = s and screen[s].geometry or root_geom
|
||||
local img = surface(root.wallpaper())
|
||||
|
@ -54,7 +54,7 @@ end
|
|||
|
||||
--- Set the current wallpaper.
|
||||
-- @param pattern The wallpaper that should be set. This can be a cairo surface,
|
||||
-- a description for gears.color or a cairo pattern.
|
||||
-- a description for gears.color or a cairo pattern.
|
||||
function wallpaper.set(pattern)
|
||||
if cairo.Surface:is_type_of(pattern) then
|
||||
pattern = cairo.Pattern.create_for_surface(pattern)
|
||||
|
@ -71,9 +71,9 @@ end
|
|||
--- Set a centered wallpaper.
|
||||
-- @param surf The wallpaper to center. Either a cairo surface or a file name.
|
||||
-- @param s The screen whose wallpaper should be set. Can be nil, in which case
|
||||
-- all screens are set.
|
||||
-- all screens are set.
|
||||
-- @param background The background color that should be used. Gets handled via
|
||||
-- gears.color. The default is black.
|
||||
-- gears.color. The default is black.
|
||||
function wallpaper.centered(surf, s, background)
|
||||
local geom, img, cr = prepare_wallpaper(s)
|
||||
local surf = surface(surf)
|
||||
|
@ -98,7 +98,7 @@ end
|
|||
--- Set a tiled wallpaper.
|
||||
-- @param surf The wallpaper to tile. Either a cairo surface or a file name.
|
||||
-- @param s The screen whose wallpaper should be set. Can be nil, in which case
|
||||
-- all screens are set.
|
||||
-- all screens are set.
|
||||
-- @param offset This can be set to a table with entries x and y.
|
||||
function wallpaper.tiled(surf, s, offset)
|
||||
local geom, img, cr = prepare_wallpaper(s)
|
||||
|
@ -119,9 +119,9 @@ end
|
|||
--- Set a maximized wallpaper.
|
||||
-- @param surf The wallpaper to set. Either a cairo surface or a file name.
|
||||
-- @param s The screen whose wallpaper should be set. Can be nil, in which case
|
||||
-- all screens are set.
|
||||
-- all screens are set.
|
||||
-- @param ignore_aspect If this is true, the image's aspect ratio is ignored.
|
||||
-- The default is to honor the aspect ratio.
|
||||
-- The default is to honor the aspect ratio.
|
||||
-- @param offset This can be set to a table with entries x and y.
|
||||
function wallpaper.maximized(surf, s, ignore_aspect, offset)
|
||||
local geom, img, cr = prepare_wallpaper(s)
|
||||
|
@ -154,9 +154,9 @@ end
|
|||
--- Set a fitting wallpaper.
|
||||
-- @param surf The wallpaper to set. Either a cairo surface or a file name.
|
||||
-- @param s The screen whose wallpaper should be set. Can be nil, in which case
|
||||
-- all screens are set.
|
||||
-- all screens are set.
|
||||
-- @param background The background color that should be used. Gets handled via
|
||||
-- gears.color. The default is black.
|
||||
-- gears.color. The default is black.
|
||||
function wallpaper.fit(surf, s, background)
|
||||
local geom, img, cr = prepare_wallpaper(s)
|
||||
local surf = surface(surf)
|
||||
|
|
|
@ -1,7 +1,23 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Menubar module, which aims to provide a freedesktop menu alternative
|
||||
--
|
||||
-- List of menubar keybindings:
|
||||
-- ---
|
||||
--
|
||||
-- * "Left" | "C-j" select an item on the left
|
||||
-- * "Right" | "C-k" select an item on the right
|
||||
-- * "Backspace" exit the current category if we are in any
|
||||
-- * "Escape" exit the current directory or exit menubar
|
||||
-- * "Home" select the first item
|
||||
-- * "End" select the last
|
||||
-- * "Return" execute the entry
|
||||
-- * "C-Return" execute the command with awful.util.spawn
|
||||
-- * "C-M-Return" execute the command in a terminal
|
||||
--
|
||||
-- @author Alexander Yakushev <yakushev.alex@gmail.com>
|
||||
-- @copyright 2011-2012 Alexander Yakushev
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module menubar
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment we need
|
||||
|
@ -21,22 +37,6 @@ menubar.menu_gen = require("menubar.menu_gen")
|
|||
menubar.utils = require("menubar.utils")
|
||||
local compute_text_width = menubar.utils.compute_text_width
|
||||
|
||||
--- List of menubar keybindings:
|
||||
-- <p><ul>
|
||||
-- <li>"Left" | "C-j" select an item on the left</li>
|
||||
-- <li>"Right" | "C-k" select an item on the right</li>
|
||||
-- <li>"Backspace" exit the current category if we are in any</li>
|
||||
-- <li>"Escape" exit the current directory or exit menubar</li>
|
||||
-- <li>"Home" select the first item</li>
|
||||
-- <li>"End" select the last</li>
|
||||
-- <li>"Return" execute the entry</li>
|
||||
-- <li>"C-Return" execute the command with awful.util.spawn</li>
|
||||
-- <li>"C-M-Return" execute the command in a terminal</li>
|
||||
-- </ul></p>
|
||||
--
|
||||
-- @class table
|
||||
-- @name Menubar keybindings
|
||||
|
||||
-- Options section
|
||||
|
||||
--- When true the .desktop files will be reparsed only when the
|
||||
|
@ -81,7 +81,7 @@ local instance = { prompt = nil,
|
|||
local common_args = { w = wibox.layout.fixed.horizontal(),
|
||||
data = setmetatable({}, { __mode = 'kv' }) }
|
||||
|
||||
-- Wrap the text with the color span tag.
|
||||
--- Wrap the text with the color span tag.
|
||||
-- @param s The text.
|
||||
-- @param c The desired text color.
|
||||
-- @return the text wrapped in a span tag.
|
||||
|
@ -89,7 +89,7 @@ local function colortext(s, c)
|
|||
return "<span color='" .. c .. "'>" .. s .. "</span>"
|
||||
end
|
||||
|
||||
-- Get how the menu item should be displayed.
|
||||
--- Get how the menu item should be displayed.
|
||||
-- @param o The menu item.
|
||||
-- @return item name, item background color, background image, item icon.
|
||||
local function label(o)
|
||||
|
@ -101,7 +101,7 @@ local function label(o)
|
|||
end
|
||||
end
|
||||
|
||||
-- Perform an action for the given menu item.
|
||||
--- Perform an action for the given menu item.
|
||||
-- @param o The menu item.
|
||||
-- @return if the function processed the callback, new awful.prompt command, new awful.prompt prompt text.
|
||||
local function perform_action(o)
|
||||
|
@ -120,8 +120,8 @@ local function perform_action(o)
|
|||
end
|
||||
end
|
||||
|
||||
-- Cut item list to return only current page
|
||||
-- @tparam table all_item All items list
|
||||
--- Cut item list to return only current page.
|
||||
-- @tparam table all_items All items list.
|
||||
-- @tparam str query Search query.
|
||||
-- @return table List of items for current page.
|
||||
local function get_current_page(all_items, query)
|
||||
|
@ -159,8 +159,8 @@ local function get_current_page(all_items, query)
|
|||
return current_page
|
||||
end
|
||||
|
||||
-- Update the menubar according to the command entered by user.
|
||||
-- @param query The text to filter entries by.
|
||||
--- Update the menubar according to the command entered by user.
|
||||
-- @tparam str query Search query.
|
||||
local function menulist_update(query)
|
||||
query = query or ""
|
||||
shownitems = {}
|
||||
|
@ -225,7 +225,7 @@ local function menulist_update(query)
|
|||
get_current_page(shownitems, query))
|
||||
end
|
||||
|
||||
-- Create the menubar wibox and widgets.
|
||||
--- Create the menubar wibox and widgets.
|
||||
local function initialize()
|
||||
instance.wibox = wibox({})
|
||||
instance.widget = menubar.get()
|
||||
|
@ -242,7 +242,7 @@ function menubar.refresh()
|
|||
menubar.menu_entries = menubar.menu_gen.generate()
|
||||
end
|
||||
|
||||
-- Awful.prompt keypressed callback to be used when the user presses a key.
|
||||
--- Awful.prompt keypressed callback to be used when the user presses a key.
|
||||
-- @param mod Table of key combination modifiers (Control, Shift).
|
||||
-- @param key The key that was pressed.
|
||||
-- @param comm The current command in the prompt.
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Menu generation module for menubar
|
||||
--
|
||||
-- @author Antonio Terceiro
|
||||
-- @copyright 2009, 2011-2012 Antonio Terceiro, Alexander Yakushev
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module menubar.menu_gen
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment
|
||||
|
@ -11,8 +14,6 @@ local ipairs = ipairs
|
|||
local string = string
|
||||
local table = table
|
||||
|
||||
-- Menu generation module for menubar
|
||||
-- menubar.menu_gen
|
||||
local menu_gen = {}
|
||||
|
||||
-- Options section
|
||||
|
@ -59,7 +60,7 @@ function menu_gen.lookup_category_icons()
|
|||
end
|
||||
end
|
||||
|
||||
-- Get category key name and whether it is used by its app_type.
|
||||
--- Get category key name and whether it is used by its app_type.
|
||||
-- @param app_type Application category as written in .desktop file.
|
||||
-- @return category key name in all_categories, whether the category is used
|
||||
local function get_category_name_and_usage_by_type(app_type)
|
||||
|
@ -70,7 +71,7 @@ local function get_category_name_and_usage_by_type(app_type)
|
|||
end
|
||||
end
|
||||
|
||||
-- Remove CR\LF newline from the end of the string.
|
||||
--- Remove CR\LF newline from the end of the string.
|
||||
-- @param s string to trim
|
||||
local function trim(s)
|
||||
if not s then return end
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Utility module for menubar
|
||||
--
|
||||
-- @author Antonio Terceiro
|
||||
-- @copyright 2009, 2011-2012 Antonio Terceiro, Alexander Yakushev
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module menubar.utils
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Grab environment
|
||||
|
@ -14,8 +17,6 @@ local theme = require("beautiful")
|
|||
local glib = require("lgi").GLib
|
||||
local wibox = require("wibox")
|
||||
|
||||
-- Utility module for menubar
|
||||
-- menubar.utils
|
||||
local utils = {}
|
||||
|
||||
-- NOTE: This icons/desktop files module was written according to the
|
||||
|
@ -28,7 +29,7 @@ local utils = {}
|
|||
--- Terminal which applications that need terminal would open in.
|
||||
utils.terminal = 'xterm'
|
||||
|
||||
-- The default icon for applications that don't provide any icon in
|
||||
--- The default icon for applications that don't provide any icon in
|
||||
-- their .desktop files.
|
||||
local default_icon = nil
|
||||
|
||||
|
@ -50,10 +51,10 @@ local all_icon_sizes = {
|
|||
'16x16'
|
||||
}
|
||||
|
||||
-- List of supported icon formats.
|
||||
--- List of supported icon formats.
|
||||
local icon_formats = { "png", "xpm", "svg" }
|
||||
|
||||
-- Check whether the icon format is supported.
|
||||
--- Check whether the icon format is supported.
|
||||
-- @param icon_file Filename of the icon.
|
||||
-- @return true if format is supported, false otherwise.
|
||||
local function is_format_supported(icon_file)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
----------------------------------------------------------------------------
|
||||
--- Notification library
|
||||
--
|
||||
-- @author koniu <gkusnierz@gmail.com>
|
||||
-- @copyright 2008 koniu
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module naughty
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
-- Package environment
|
||||
|
@ -21,40 +24,66 @@ local wibox = require("wibox")
|
|||
local surface = require("gears.surface")
|
||||
local cairo = require("lgi").cairo
|
||||
|
||||
--- Notification library
|
||||
local schar = string.char
|
||||
local sbyte = string.byte
|
||||
local tcat = table.concat
|
||||
local tins = table.insert
|
||||
|
||||
local naughty = {}
|
||||
|
||||
--- Naughty configuration - a table containing common popup settings.
|
||||
naughty.config = {}
|
||||
--- Space between popups and edge of the workarea. Default: 4
|
||||
naughty.config.padding = 4
|
||||
--- Spacing between popups. Default: 1
|
||||
naughty.config.spacing = 1
|
||||
--- List of directories that will be checked by getIcon()
|
||||
-- Default: { "/usr/share/pixmaps/", }
|
||||
naughty.config.icon_dirs = { "/usr/share/pixmaps/", }
|
||||
--- List of formats that will be checked by getIcon()
|
||||
-- Default: { "png", "gif" }
|
||||
naughty.config.icon_formats = { "png", "gif" }
|
||||
--- Callback used to modify or reject notifications.
|
||||
-- Default: nil
|
||||
-- Example:
|
||||
-- naughty.config.notify_callback = function(args)
|
||||
-- args.text = 'prefix: ' .. args.text
|
||||
-- return args
|
||||
-- end
|
||||
naughty.config.notify_callback = nil
|
||||
--[[--
|
||||
Naughty configuration - a table containing common popup settings.
|
||||
|
||||
@table naughty.config
|
||||
@field padding Space between popups and edge of the workarea.
|
||||
Default: `4`
|
||||
@field spacing Spacing between popups.
|
||||
Default: `1`
|
||||
@field icon_dirs List of directories that will be checked by `getIcon()`.
|
||||
Default: `{ "/usr/share/pixmaps/", }`
|
||||
@field icon_formats List of formats that will be checked by `getIcon()`.
|
||||
Default: `{ "png", "gif" }`
|
||||
@field notify_callback Callback used to modify or reject notifications.
|
||||
Default: `nil`
|
||||
naughty.config.notify_callback = function(args)
|
||||
args.text = 'prefix: ' .. args.text
|
||||
return args
|
||||
end
|
||||
|
||||
@field presets Notification Presets - a table containing presets for
|
||||
different purposes. Preset is a table of any parameters available to
|
||||
`notify()`, overriding default values (`naughty.config.defaults`) You have
|
||||
to pass a reference of a preset in your notify() call to use the preset The
|
||||
presets `"low"`, `"normal"` and `"critical"` are used for notifications
|
||||
over DBUS.
|
||||
|
||||
@field presets.low The preset for notifications with low urgency level.
|
||||
@field presets.normal The default preset for every notification without a
|
||||
preset that will also be used for normal urgency level.
|
||||
@field presets.critical The preset for notifications with a critical urgency
|
||||
level.
|
||||
|
||||
@field defaults Default values for the params to `notify()`.
|
||||
These can optionally be overridden by specifying a preset.
|
||||
|
||||
@field mapping DBUS notification to preset mapping.
|
||||
The first element is an object containing the filter If the rules in the
|
||||
filter matches the associated preset will be applied The rules object can
|
||||
contain: urgency, category, appname The second element is the preset
|
||||
|
||||
@field mapping.1 low urgency
|
||||
@field mapping.2 normal urgency
|
||||
@field mapping.3 critical urgency
|
||||
--]]
|
||||
--
|
||||
naughty.config = {
|
||||
padding = 4,
|
||||
spacing = 1,
|
||||
icon_dirs = { "/usr/share/pixmaps/", },
|
||||
icon_formats = { "png", "gif" },
|
||||
notify_callback = nil,
|
||||
}
|
||||
|
||||
--- Notification Presets - a table containing presets for different purposes
|
||||
-- Preset is a table of any parameters available to notify(), overriding default
|
||||
-- values (@see defaults)
|
||||
-- You have to pass a reference of a preset in your notify() call to use the preset
|
||||
-- The presets "low", "normal" and "critical" are used for notifications over DBUS
|
||||
-- @field low The preset for notifications with low urgency level
|
||||
-- @field normal The default preset for every notification without a preset that will also be used for normal urgency level
|
||||
-- @field critical The preset for notifications with a critical urgency level
|
||||
-- @table naughty.config.presets
|
||||
naughty.config.presets = {
|
||||
low = {
|
||||
timeout = 5
|
||||
|
@ -67,10 +96,6 @@ naughty.config.presets = {
|
|||
}
|
||||
}
|
||||
|
||||
--- Default values for the params to notify().
|
||||
-- These can optionally be overridden by specifying a preset
|
||||
-- @see naughty.config.presets
|
||||
-- @see naughty.notify
|
||||
naughty.config.defaults = {
|
||||
timeout = 5,
|
||||
text = "",
|
||||
|
@ -96,14 +121,16 @@ local counter = 1
|
|||
-- True if notifying is suspended
|
||||
local suspended = false
|
||||
|
||||
--- Index of notifications per screen and position. See config table for valid
|
||||
-- 'position' values. Each element is a table consisting of:
|
||||
--- Index of notifications per screen and position.
|
||||
-- See config table for valid 'position' values.
|
||||
-- Each element is a table consisting of:
|
||||
--
|
||||
-- @field box Wibox object containing the popup
|
||||
-- @field height Popup height
|
||||
-- @field width Popup width
|
||||
-- @field die Function to be executed on timeout
|
||||
-- @field id Unique notification id based on a counter
|
||||
-- @table naughty.notifications
|
||||
-- @table notifications
|
||||
naughty.notifications = { suspended = { } }
|
||||
for s = 1, capi.screen.count() do
|
||||
naughty.notifications[s] = {
|
||||
|
@ -140,12 +167,14 @@ function naughty.toggle()
|
|||
end
|
||||
end
|
||||
|
||||
-- Evaluate desired position of the notification by index - internal
|
||||
-- @param idx Index of the notification
|
||||
--- Evaluate desired position of the notification by index - internal
|
||||
--
|
||||
-- @param screen Screen to use
|
||||
-- @param position top_right | top_left | bottom_right | bottom_left
|
||||
-- | top_middle | bottom_middle
|
||||
-- @param idx Index of the notification
|
||||
-- @param[opt] width Popup width.
|
||||
-- @param height Popup height
|
||||
-- @param width Popup width (optional)
|
||||
-- @return Absolute position and index in { x = X, y = Y, idx = I } table
|
||||
local function get_offset(screen, position, idx, width, height)
|
||||
local ws = capi.screen[screen].workarea
|
||||
|
@ -186,7 +215,8 @@ local function get_offset(screen, position, idx, width, height)
|
|||
return v
|
||||
end
|
||||
|
||||
-- Re-arrange notifications according to their position and index - internal
|
||||
--- Re-arrange notifications according to their position and index - internal
|
||||
--
|
||||
-- @return None
|
||||
local function arrange(screen)
|
||||
for p,pos in pairs(naughty.notifications[screen]) do
|
||||
|
@ -199,6 +229,7 @@ local function arrange(screen)
|
|||
end
|
||||
|
||||
--- Destroy notification by notification object
|
||||
--
|
||||
-- @param notification Notification object to be destroyed
|
||||
-- @param reason One of the reasons from notificationClosedReason
|
||||
-- @return True if the popup was successfully destroyed, nil otherwise
|
||||
|
@ -226,7 +257,8 @@ function naughty.destroy(notification, reason)
|
|||
end
|
||||
end
|
||||
|
||||
-- Get notification by ID
|
||||
--- Get notification by ID
|
||||
--
|
||||
-- @param id ID of the notification
|
||||
-- @return notification object if it was found, nil otherwise
|
||||
function naughty.getById(id)
|
||||
|
@ -242,38 +274,56 @@ function naughty.getById(id)
|
|||
end
|
||||
end
|
||||
|
||||
--- Create notification. args is a dictionary of (optional) arguments.
|
||||
-- @param text Text of the notification. Default: ''
|
||||
-- @param title Title of the notification. Default: nil
|
||||
-- @param timeout Time in seconds after which popup expires.
|
||||
-- Set 0 for no timeout. Default: 5
|
||||
-- @param hover_timeout Delay in seconds after which hovered popup disappears.
|
||||
--- Create a notification.
|
||||
--
|
||||
-- @tab args The argument table containing any of the arguments below.
|
||||
-- @string args.text Text of the notification.
|
||||
-- Default: ''
|
||||
-- @string args.title Title of the notification.
|
||||
-- Default: nil
|
||||
-- @param screen Target screen for the notification. Default: 1
|
||||
-- @param position Corner of the workarea displaying the popups.
|
||||
-- Values: "top_right" (default), "top_left", "bottom_left", "bottom_right",
|
||||
-- "top_middle", "bottom_middle".
|
||||
-- @param ontop Boolean forcing popups to display on top. Default: true
|
||||
-- @param height Popup height. Default: nil (auto)
|
||||
-- @param width Popup width. Default: nil (auto)
|
||||
-- @param font Notification font. Default: beautiful.font or awesome.font
|
||||
-- @param icon Path to icon. Default: nil
|
||||
-- @param icon_size Desired icon size in px. Default: nil
|
||||
-- @param fg Foreground color. Default: beautiful.fg_focus or '#ffffff'
|
||||
-- @param bg Background color. Default: beautiful.bg_focus or '#535d6c'
|
||||
-- @param border_width Border width. Default: 1
|
||||
-- @param border_color Border color.
|
||||
-- Default: beautiful.border_focus or '#535d6c'
|
||||
-- @param run Function to run on left click. Default: nil
|
||||
-- @param destroy Function to run when notification is destroyed. Default: nil
|
||||
-- @param preset Table with any of the above parameters. Note: Any parameters
|
||||
-- specified directly in args will override ones defined in the preset.
|
||||
-- @param replaces_id Replace the notification with the given ID
|
||||
-- @param callback function that will be called with all arguments
|
||||
-- the notification will only be displayed if the function returns true
|
||||
-- note: this function is only relevant to notifications sent via dbus
|
||||
-- @param actions mapping that maps a string to a callback when this action is
|
||||
-- selected
|
||||
-- @int args.timeout Time in seconds after which popup expires.
|
||||
-- Set 0 for no timeout.
|
||||
-- Default: 5
|
||||
-- @int args.hover_timeout Delay in seconds after which hovered popup disappears.
|
||||
-- Default: nil
|
||||
-- @int args.screen Target screen for the notification.
|
||||
-- Default: 1
|
||||
-- @string args.position Corner of the workarea displaying the popups.
|
||||
-- Values: `"top_right"` (default), `"top_left"`, `"bottom_left"`,
|
||||
-- `"bottom_right"`, `"top_middle"`, `"bottom_middle"`.
|
||||
-- @bool args.ontop Boolean forcing popups to display on top.
|
||||
-- Default: true
|
||||
-- @int args.height Popup height.
|
||||
-- Default: nil (auto)
|
||||
-- @int args.width Popup width.
|
||||
-- Default: nil (auto)
|
||||
-- @string args.font Notification font.
|
||||
-- Default: beautiful.font or awesome.font
|
||||
-- @string args.icon Path to icon.
|
||||
-- Default: nil
|
||||
-- @int args.icon_size Desired icon size in px.
|
||||
-- Default: nil
|
||||
-- @string args.fg Foreground color.
|
||||
-- Default: `beautiful.fg_focus` or `'#ffffff'`
|
||||
-- @string args.bg Background color.
|
||||
-- Default: `beautiful.bg_focus` or `'#535d6c'`
|
||||
-- @int args.border_width Border width.
|
||||
-- Default: 1
|
||||
-- @string args.border_color Border color.
|
||||
-- Default: `beautiful.border_focus` or `'#535d6c'`
|
||||
-- @tparam func args.run Function to run on left click. Default: nil
|
||||
-- @tparam func args.destroy Function to run when notification is destroyed. Default: nil.
|
||||
-- @tparam table args.preset Table with any of the above parameters.
|
||||
-- Note: Any parameters specified directly in args
|
||||
-- will override ones defined in the preset.
|
||||
-- @tparam int args.replaces_id Replace the notification with the given ID.
|
||||
-- @tparam func args.callback Function that will be called with all arguments.
|
||||
-- The notification will only be displayed if the
|
||||
-- function returns true.
|
||||
-- Note: this function is only relevant to
|
||||
-- notifications sent via dbus.
|
||||
-- @tparam table args.actions Mapping that maps a string to a callback when this
|
||||
-- action is selected.
|
||||
-- @usage naughty.notify({ title = "Achtung!", text = "You're idling", timeout = 0 })
|
||||
-- @return The notification object
|
||||
function naughty.notify(args)
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
---------------------------------------------------------------------------
|
||||
-- DBUS/Notification support
|
||||
-- Notify
|
||||
--
|
||||
-- @author koniu <gkusnierz@gmail.com>
|
||||
-- @copyright 2008 koniu
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module naughty.dbus
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- DBUS/Notification support
|
||||
-- Notify
|
||||
|
||||
assert(dbus)
|
||||
|
||||
-- Package environment
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter <psychon@znc.in>
|
||||
-- @copyright 2014 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @module naughty
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local naughty = require("naughty.core")
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Handling of drawables. A drawable is something that can be drawn to.
|
||||
--
|
||||
-- @author Uli Schlachter
|
||||
-- @copyright 2012 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.drawable
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local drawable = {}
|
||||
|
@ -82,7 +85,7 @@ end
|
|||
-- @param x X coordinate of the point
|
||||
-- @param y Y coordinate of the point
|
||||
-- @return A sorted table with all widgets that contain the given point. The
|
||||
-- widgets are sorted by relevance.
|
||||
-- widgets are sorted by relevance.
|
||||
function drawable:find_widgets(x, y)
|
||||
local matches = {}
|
||||
-- Find all widgets that contain the point
|
||||
|
@ -126,7 +129,7 @@ end
|
|||
|
||||
--- Set the background of the drawable
|
||||
-- @param c The background to use. This must either be a cairo pattern object,
|
||||
-- nil or a string that gears.color() understands.
|
||||
-- nil or a string that gears.color() understands.
|
||||
function drawable:set_bg(c)
|
||||
local c = c or "#000000"
|
||||
if type(c) == "string" or type(c) == "table" then
|
||||
|
@ -156,7 +159,7 @@ end
|
|||
|
||||
--- Set the foreground of the drawable
|
||||
-- @param c The foreground to use. This must either be a cairo pattern object,
|
||||
-- nil or a string that gears.color() understands.
|
||||
-- nil or a string that gears.color() understands.
|
||||
function drawable:set_fg(c)
|
||||
local c = c or "#FFFFFF"
|
||||
if type(c) == "string" or type(c) == "table" then
|
||||
|
@ -299,10 +302,6 @@ capi.awesome.connect_signal("wallpaper_changed", function()
|
|||
end
|
||||
end)
|
||||
|
||||
--- Handling of drawables. A drawable is something that can be drawn to.
|
||||
-- @class table
|
||||
-- @name drawable
|
||||
|
||||
return setmetatable(drawable, { __call = function(_, ...) return drawable.new(...) end })
|
||||
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local capi = {
|
||||
|
@ -36,14 +37,14 @@ end
|
|||
|
||||
--- Set the background of the wibox
|
||||
-- @param c The background to use. This must either be a cairo pattern object,
|
||||
-- nil or a string that gears.color() understands.
|
||||
-- nil or a string that gears.color() understands.
|
||||
function wibox:set_bg(c)
|
||||
self._drawable:set_bg(c)
|
||||
end
|
||||
|
||||
--- Set the foreground of the wibox
|
||||
-- @param c The foreground to use. This must either be a cairo pattern object,
|
||||
-- nil or a string that gears.color() understands.
|
||||
-- nil or a string that gears.color() understands.
|
||||
function wibox:set_fg(c)
|
||||
self._drawable:set_fg(c)
|
||||
end
|
||||
|
@ -140,16 +141,14 @@ end
|
|||
--- Redraw a wibox. You should never have to call this explicitely because it is
|
||||
-- automatically called when needed.
|
||||
-- @param wibox
|
||||
-- @name draw
|
||||
-- @class function
|
||||
-- @function draw
|
||||
|
||||
--- Widget box object.
|
||||
-- Every wibox "inherits" from a drawin and you can use all of drawin's
|
||||
-- functions directly on this as well. When creating a wibox, you can specify a
|
||||
-- "fg" and a "bg" color as keys in the table that is passed to the constructor.
|
||||
-- All other arguments will be passed to drawin's constructor.
|
||||
-- @class table
|
||||
-- @name drawin
|
||||
-- @table drawin
|
||||
|
||||
function wibox.mt:__call(...)
|
||||
return new(...)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.align
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local setmetatable = setmetatable
|
||||
|
@ -12,7 +13,6 @@ local floor = math.floor
|
|||
local base = require("wibox.layout.base")
|
||||
local widget_base = require("wibox.widget.base")
|
||||
|
||||
-- wibox.layout.align
|
||||
local align = {}
|
||||
|
||||
--- Draw an align layout.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.base
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local pairs = pairs
|
||||
|
@ -10,7 +11,6 @@ local print = print
|
|||
local min = math.min
|
||||
local max = math.max
|
||||
|
||||
-- wibox.layout.base
|
||||
local base = {}
|
||||
|
||||
--- Figure out the geometry in device coordinate space. This gives only tight
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Lukáš Hrázký
|
||||
-- @copyright 2012 Lukáš Hrázký
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.constraint
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local pairs = pairs
|
||||
|
@ -11,7 +12,6 @@ local base = require("wibox.layout.base")
|
|||
local widget_base = require("wibox.widget.base")
|
||||
local math = math
|
||||
|
||||
-- wibox.layout.constraint
|
||||
local constraint = { mt = {} }
|
||||
|
||||
--- Draw a constraint layout
|
||||
|
@ -103,11 +103,11 @@ end
|
|||
-- that respect the widget's size, eg. fixed layout. In layouts that don't
|
||||
-- (fully) respect widget's requested size, the inner widget still might get
|
||||
-- drawn with a size that does not fit the constraint, eg. in flex layout.
|
||||
-- @param widget A widget to use (optional)
|
||||
-- @param strategy How to constraint the size. 'max' (default), 'min' or
|
||||
-- 'exact'. (optional)
|
||||
-- @param width The maximum width of the widget. nil for no limit. (optional)
|
||||
-- @param height The maximum height of the widget. nil for no limit. (optional)
|
||||
-- @param[opt] widget A widget to use.
|
||||
-- @param[opt] strategy How to constraint the size. 'max' (default), 'min' or
|
||||
-- 'exact'.
|
||||
-- @param[opt] width The maximum width of the widget. nil for no limit.
|
||||
-- @param[opt] height The maximum height of the widget. nil for no limit.
|
||||
local function new(widget, strategy, width, height)
|
||||
local ret = widget_base.make_widget()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.fixed
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local base = require("wibox.layout.base")
|
||||
|
@ -9,7 +10,6 @@ local widget_base = require("wibox.widget.base")
|
|||
local table = table
|
||||
local pairs = pairs
|
||||
|
||||
-- wibox.layout.fixed
|
||||
local fixed = {}
|
||||
|
||||
--- Draw a fixed layout. Each widget gets just the space it asks for.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.flex
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local base = require("wibox.layout.base")
|
||||
|
@ -10,7 +11,6 @@ local table = table
|
|||
local pairs = pairs
|
||||
local floor = math.floor
|
||||
|
||||
-- wibox.layout.flex
|
||||
local flex = {}
|
||||
|
||||
local function round(x)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- Collection of layouts that can be used in widget boxes
|
||||
--
|
||||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- Collection of layouts that can be used in widget boxes
|
||||
-- wibox.layout
|
||||
|
||||
return
|
||||
{
|
||||
base = require("wibox.layout.base");
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.margin
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local pairs = pairs
|
||||
|
@ -12,7 +13,6 @@ local widget_base = require("wibox.widget.base")
|
|||
local gcolor = require("gears.color")
|
||||
local cairo = require("lgi").cairo
|
||||
|
||||
-- wibox.layout.margin
|
||||
local margin = { mt = {} }
|
||||
|
||||
--- Draw a margin layout
|
||||
|
@ -120,12 +120,12 @@ for k, v in pairs({ "left", "right", "top", "bottom" }) do
|
|||
end
|
||||
|
||||
--- Returns a new margin layout.
|
||||
-- @param widget A widget to use (optional)
|
||||
-- @param left A margin to use on the left side of the widget (optional)
|
||||
-- @param right A margin to use on the right side of the widget (optional)
|
||||
-- @param top A margin to use on the top side of the widget (optional)
|
||||
-- @param bottom A margin to use on the bottom side of the widget (optional)
|
||||
-- @param color A color for the margins (optional)
|
||||
-- @param[opt] widget A widget to use.
|
||||
-- @param[opt] left A margin to use on the left side of the widget.
|
||||
-- @param[opt] right A margin to use on the right side of the widget.
|
||||
-- @param[opt] top A margin to use on the top side of the widget.
|
||||
-- @param[opt] bottom A margin to use on the bottom side of the widget.
|
||||
-- @param[opt] color A color for the margins.
|
||||
local function new(widget, left, right, top, bottom, color)
|
||||
local ret = widget_base.make_widget()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author dodo
|
||||
-- @copyright 2012 dodo
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.mirror
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local type = type
|
||||
|
@ -12,7 +13,6 @@ local setmetatable = setmetatable
|
|||
local base = require("wibox.layout.base")
|
||||
local widget_base = require("wibox.widget.base")
|
||||
|
||||
-- wibox.layout.mirror
|
||||
local mirror = { mt = {} }
|
||||
|
||||
--- Draw this layout
|
||||
|
@ -98,8 +98,8 @@ end
|
|||
-- :set_widget() to set the widget and
|
||||
-- :set_horizontal() and :set_vertical() for the direction.
|
||||
-- horizontal and vertical are by default false which doesn't change anything.
|
||||
-- @param widget The widget to display (optional)
|
||||
-- @param reflection A table describing the reflection to apply (optional)
|
||||
-- @param[opt] widget The widget to display.
|
||||
-- @param[opt] reflection A table describing the reflection to apply.
|
||||
local function new(widget, reflection)
|
||||
local ret = widget_base.make_widget()
|
||||
ret.horizontal = false
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.layout.rotate
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local error = error
|
||||
|
@ -13,7 +14,6 @@ local tostring = tostring
|
|||
local base = require("wibox.layout.base")
|
||||
local widget_base = require("wibox.widget.base")
|
||||
|
||||
-- wibox.layout.rotate
|
||||
local rotate = { mt = {} }
|
||||
|
||||
local function transform(layout, width, height)
|
||||
|
@ -99,8 +99,8 @@ end
|
|||
--- Returns a new rotate layout. A rotate layout rotates a given widget. Use
|
||||
-- :set_widget() to set the widget and :set_direction() for the direction.
|
||||
-- The default direction is "north" which doesn't change anything.
|
||||
-- @param widget The widget to display (optional)
|
||||
-- @param dir The direction to rotate to (optional)
|
||||
-- @param[opt] widget The widget to display.
|
||||
-- @param[opt] dir The direction to rotate to.
|
||||
local function new(widget, dir)
|
||||
local ret = widget_base.make_widget()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.widget.background
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local base = require("wibox.widget.base")
|
||||
|
@ -13,7 +14,6 @@ local setmetatable = setmetatable
|
|||
local pairs = pairs
|
||||
local type = type
|
||||
|
||||
-- wibox.widget.background
|
||||
local background = { mt = {} }
|
||||
|
||||
--- Draw this widget
|
||||
|
@ -96,8 +96,8 @@ end
|
|||
|
||||
--- Returns a new background layout. A background layout applies a background
|
||||
-- and foreground color to another widget.
|
||||
-- @param widget The widget to display (optional)
|
||||
-- @param bg The background to use for that widget (optional)
|
||||
-- @param[opt] widget The widget to display.
|
||||
-- @param[opt] bg The background to use for that widget.
|
||||
local function new(widget, bg)
|
||||
local ret = base.make_widget()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.widget.base
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local debug = require("gears.debug")
|
||||
|
@ -11,7 +12,6 @@ local pairs = pairs
|
|||
local type = type
|
||||
local table = table
|
||||
|
||||
-- wibox.widget.base
|
||||
local base = {}
|
||||
|
||||
--- Set/get a widget's buttons
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.widget.imagebox
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local base = require("wibox.widget.base")
|
||||
|
@ -12,7 +13,6 @@ local type = type
|
|||
local pcall = pcall
|
||||
local print = print
|
||||
|
||||
-- wibox.widget.imagebox
|
||||
local imagebox = { mt = {} }
|
||||
|
||||
--- Draw an imagebox with the given cairo context in the given geometry.
|
||||
|
@ -113,7 +113,7 @@ function imagebox:set_resize(allowed)
|
|||
self:emit_signal("widget::updated")
|
||||
end
|
||||
|
||||
-- Returns a new imagebox
|
||||
--- Returns a new imagebox
|
||||
-- @param image the image to display, may be nil
|
||||
-- @param resize_allowed If false, the image will be clipped, else it will be resized
|
||||
-- to fit into the available space.
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
-- @author Uli Schlachter
|
||||
-- @copyright 2010 Uli Schlachter
|
||||
-- @release @AWESOME_VERSION@
|
||||
-- @classmod wibox.widget
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
--- wibox.widget
|
||||
|
||||
return
|
||||
{
|
||||
base = require("wibox.widget.base");
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue