Go to file
Uli Schlachter b9361d54c6 gears.color: Add a pattern cache
This makes gears.color() cache patterns in a weak table and returns that cached
pattern when we get called with the same argument again.

To benchmark this change, the following code was used:

local time = require("socket").gettime

function benchmark(func)
   local begin = time()
   local iter = 0
   while time() - begin < 1 do
      func()
      iter = iter + 1
   end
   return iter
end

for _, arg in pairs({
   "#00aa00",
   "solid:#00aa00",
   "radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff",
   "linear:1,2:3,4:0,#000000:1,#ffffff",
   "png:/home/psychon/Wallpaper/Bars.png",
   { type = "solid", color = "#00aa00" },
   { type = "radial", from = { 50, 50, 10 }, to = { 55, 55, 30 }, stops = { { 0, "#ff0000" }, { 0.5, "#00ff00" }, { 1, "#0000ff" } } },
   { type = "linear", from = { 1, 2 }, to = { 3, 4 }, stops = { { 0, "#000000" }, { 1, "#ffffff" } } },
   { type = "png", file = "/home/psychon/Wallpaper/Bars.png" },
}) do
   collectgarbage("collect")
   print(benchmark(function() gears.color.create_pattern(arg) end), arg)
end

Before this change (larger numbers are better, this measures how many times we
can create the given pattern per second):

29525   #00aa00
29344   solid:#00aa00
3446    radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff
4845    linear:1,2:3,4:0,#000000:1,#ffffff
32855   png:/home/psychon/Wallpaper/Bars.png
29883   table: 0x1bb67e0
3868    table: 0x1bb6830
5339    table: 0x1bb6c60
32772   table: 0x1bb6fe0

After this change:

126188  #00aa00
125962  solid:#00aa00
125125  radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff
125213  linear:1,2:3,4:0,#000000:1,#ffffff
113659  png:/home/psychon/Wallpaper/Bars.png
125586  table: 0x1232680
125249  table: 0x12326d0
125468  table: 0x1232b00
113711  table: 0x1232e80

As you see, this makes some cases about 35 times faster (although I have to
admit that something like this can be expected from such a synthetic benchmark).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-29 22:52:04 +01:00
build-tests use CMake check_function_exists() for execinfo 2010-10-11 22:52:20 +02:00
build-utils Bump minimum lgi dependency to 0.7.0 2014-03-17 17:52:09 +01:00
common Revert "client: Add c.blob property" 2014-03-07 16:21:11 +01:00
icons icons: remove invaders 2009-09-08 13:29:25 +02:00
lib gears.color: Add a pattern cache 2014-03-29 22:52:04 +01:00
luadoc awesome: Add get_* and set_xproperty 2014-03-23 18:23:34 +01:00
manpages Remove F1-9 bindings from the manpages. 2013-03-10 11:22:35 +01:00
objects Ignore enter/leave events when unmanaging a window (FS#1239) 2014-03-28 13:15:24 +01:00
themes taglist: Add [bg|fg]_empty 2013-12-02 15:10:10 +01:00
utils Remove all traces of awsetbg and wallpaper setters 2012-07-29 15:38:31 +02:00
.gitignore gitignore: remove awesome-client 2009-04-11 16:10:42 +02:00
AUTHORS update Arnaud commit years 2009-08-24 11:13:59 +02:00
BUGS BUG's page 2008-04-18 19:33:58 +02:00
CMakeLists.txt CMake: Check for the needed lgi dependency 2012-11-25 19:43:09 +01:00
LICENSE chance license to GPLv2 2007-09-12 14:29:51 +02:00
Makefile build: allow to specify cmake args 2009-05-08 19:54:38 +02:00
PATCHES PATCHES: add more rules 2009-09-02 10:36:13 +02:00
README Grammar/spelling corrections in comments and docs. 2009-08-31 10:39:36 +02:00
STYLE STYLE: add prefix rule 2009-08-21 15:30:48 +02:00
awesome-version-internal.h.in cmake: consolidate version strings 2008-06-22 22:13:06 +02:00
awesome.c client manage signal: Remove startup argument 2014-03-16 20:15:02 +01:00
awesome.desktop Remove NoDisplay from desktop file 2013-02-25 11:50:00 +01:00
awesome.doxygen.in awesome.doxygen: doxygen configuration fixes. 2009-09-04 18:18:03 +02:00
awesome.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
awesomeConfig.cmake change codename 2013-10-12 18:48:49 +02:00
awesomerc.lua.in Add and improve some comments to awesomerc.lua 2014-03-29 09:55:43 +01:00
banning.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
banning.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
color.c C color code: Ignore alpha component (FS#966) 2012-04-07 22:03:38 +02:00
color.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
config.h.in test for __builtin_clz() and fallback to an inline implementation. 2010-10-11 20:42:03 +02:00
config.ld.in Use LDoc instead of Luadoc (FS#1006) 2012-11-19 14:57:47 +01:00
dbus.c Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
dbus.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
draw.c draw: Add function for finding a visual by id 2013-09-16 11:59:00 +02:00
draw.h draw: Add function for finding a visual by id 2013-09-16 11:59:00 +02:00
event.c client manage signal: Remove startup argument 2014-03-16 20:15:02 +01:00
event.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
ewmh.c EWMH: Handle _NET_WM_DESKTOP in lua 2014-03-17 16:15:20 +01:00
ewmh.h Don't pass cairo surfaces around on the lua stack 2012-05-28 09:29:47 +02:00
globalconf.h Add awesome.register_xproperty (FS#1212) 2014-03-07 16:17:40 +01:00
keygrabber.c Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
keygrabber.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
keyresolv.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
keyresolv.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
luaa.c awesome.startup_errors: Never emit debug::index::miss 2014-03-23 19:29:04 +01:00
luaa.h Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
mouse.c Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
mouse.h Revert "Support more than 5 mouse buttons" (FS#1082) 2013-03-29 16:07:13 +01:00
mousegrabber.c Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
mousegrabber.h Revert "Support more than 5 mouse buttons" (FS#1082) 2013-03-29 16:07:13 +01:00
property.c xproperty: Emit on "awesome" for root window properties 2014-03-23 18:23:38 +01:00
property.h awesome: Add get_* and set_xproperty 2014-03-23 18:23:34 +01:00
root.c Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
screen.c Make debug::index::miss and newindex work on classes and all objects 2014-03-23 19:27:06 +01:00
screen.h screen: Fix screen equality comparison (FS#1151) 2013-10-04 15:24:09 +02:00
selection.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
selection.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
spawn.c Add end to end support for spawning tracking using startup notifications 2014-03-15 23:14:02 +01:00
spawn.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
stack.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
stack.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
strut.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
strut.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
systray.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
systray.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
xwindow.c Finish C-side support for window shapes (FS#1051) 2014-01-03 17:01:43 +01:00
xwindow.h Finish C-side support for window shapes (FS#1051) 2014-01-03 17:01:43 +01:00

README

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.