Commit Graph

226 Commits

Author SHA1 Message Date
Uli Schlachter a6fb932bbc awesome: Add get_* and set_xproperty
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 18:23:34 +01:00
Uli Schlachter 02cb961edf luaa: Remove lots of unused code
Most of these are unused since the drawing code was moved to lua. For example,
the old wibox code needed the metatable entries __next, __ipairs and __pairs so
that w.widgets worked correctly and could pretend to be a regular lua table.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-18 16:28:42 +01:00
Uli Schlachter 4d35f430dc Add awesome.startup
This boolean describes if we are still in startup or if our main loop is already
running.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 20:09:43 +01:00
Uli Schlachter 62e2dee4ba Add awesome.register_xproperty (FS#1212)
This commits adds awesome.register_xproperty(). This allows lua code to register
arbitrary X11 properties with awesome which will then watch these properties.
Whenever such a property is changed on a client or drawin, we will emit the
xproperty::name signal.

This also adds window:get_xproperty(name) and window:set_xproperty(name, value)
which allows to mess with properties.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 16:17:40 +01:00
Uli Schlachter 4717e89984 Update fields for capi.awesome in C comment
This should have been part of commit 2f39986, sorry!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 10:44:48 +01:00
Uli Schlachter 360e1a5f92 Add awesome.composite_manager_running
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-23 12:14:50 +01:00
Uli Schlachter 0c62831eea lua: Print traceback on startup errors
We do some special magic so that we can have tracebacks on errors messages.
However, the code for parsing the rc.lua called it without this magic and thus
errors didn't have tracebacks.

This is bad, because if something goes wrong in e.g. wibox.widget.textbox, you
don't really have any clue where this error is coming from.

Fix this by adding our "print traceback on error"-magic here, too.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-06-08 13:21:14 +02:00
Uli Schlachter ea30119410 Use glib instead of libev
This commit ports awesome from libev to the glib main loop. This means that
awesome has fewer dependencies, because we were already depending on glib before
and now no longer need glib.

However, the main reason for this change is that, thanks to lgi, we have glib
bindings for lua. This means that lua code can add all kinds of event sources to
the main loop (timeouts, fd watchers, SIGCHLD watchers, ....). Yay

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-21 21:01:12 +01:00
Uli Schlachter f0512eeaab Introduce drawables
A drawable is something that you can draw to, just like a drawin. However, a
drawable isn't necessarily its own windows. This will later on be used to
implement titlebars where the titlebars are drawables.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-14 17:30:54 +02:00
Arvydas Sidorenko f41590e19c Wrapped luaL_register
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-06-12 13:32:40 +02:00
Arvydas Sidorenko db0d23606d Portable way to replace standards Lua funcs
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 11:03:26 +02:00
Arvydas Sidorenko d61cdb86c9 Renamed luaL_reg to luaL_Reg
The original struct name is luaL_Reg, but Lua v5.1 had a
`typedef luaL_reg luaL_Reg`, which in v5.2 was removed
and as a result breaking the build in Awesome which uses luaL_reg
version exclusively.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 10:52:10 +02:00
Uli Schlachter e57af377bb Don't pass cairo surfaces around on the lua stack
Now that the C code uses lightuserdata for passing around cairo surfaces, they
are no longer automatically garbage collected. To avoid memleaks, this commit
compares the C code to use cairo_surface_t pointers instead of the lua stack.

This also fixes a memleak were a client's icon was leaked.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-28 09:29:47 +02:00
Uli Schlachter 4f30dfd198 Switch from oocairo to lgi.cairo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-27 19:20:34 +02:00
Uli Schlachter 2bd29f2ab4 Add a wallpaper_changed signal
This signal fires whenever the, well, wallpaper changes. Who would have guessed?

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-07 21:52:24 +02:00
Uli Schlachter 9451fec6f1 Add awesome.load_image()
This uses imlib2 for loading the image and thus supports more image formats than
just PNG.

Almost fixes: FS#958

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-29 14:08:57 +01:00
Majic ba7c7eafff Re-add missing debug::deprecation signal
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 20:43:14 +01:00
Majic 0e8fc995bb Minor readability fixes, STREQ()-like macros added
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-11-18 17:56:21 +01:00
Uli Schlachter 2354c6a623 Signal config errors via a naughty popup
If loading of any config file fails, awesome will now remember the error message
and make it available to lua. The default config is modified to open a naughty
popup on errors.

This should help all those people who modify their config and then wonder why
there change is ignored, not noticing awesome's error message on stderr.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-23 17:36:19 +02:00
Julien Danjou bf56ae79dd Set the conffile value before executing the code
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-09-17 17:23:59 +02:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Chris Newton 471babcc70 Added a flag to the exit signal
This boolean can be used to differentiate between restarts and exits.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-21 07:41:41 +01:00
Uli Schlachter ab3674ec13 luaa: Add "refresh" signal
This signal is emitted whenever awesome finishes the current event loop run.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-15 18:48:07 +02:00
Uli Schlachter 9deafe68c8 Font: Remove, oopango took over the job
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:09:17 +02:00
Uli Schlachter 6826e5dfc4 Remove globalconf.colors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:01:44 +02:00
Uli Schlachter 742c0dead0 Systray: Fix
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 15:38:44 +02:00
Uli Schlachter 5f5787d97b Wibox: Rename to drawin
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:36:02 +02:00
Uli Schlachter d213f19c5f Widgets: Remove
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:27:21 +02:00
Uli Schlachter db3b1fe431 Image: Remove
Everything now uses oocairo instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 19:36:58 +02:00
Uli Schlachter 44f64eee58 Automatically load oocairo and oopango on startup
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-09 16:54:50 +02:00
Uli Schlachter f2e9767434 luaa: Stop using a_tokenize()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-02 19:08:08 +02:00
Uli Schlachter 932e0bfcd0 Add two more missing signals
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-27 21:42:14 +02:00
Uli Schlachter e0774377ca Sort all signal lists alphabetically
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:46:17 +02:00
Uli Schlachter ab4c151ed8 Add signals before using them
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 23:00:36 +02:00
Uli Schlachter 948f960b7e Also rename the signal_* C function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 20:48:42 +02:00
Julien Danjou 6d332f07a0 lua{class,object}: rename signals functions
I knew this was wrong at the beginning, f*ck.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Uli Schlachter 1d95153286 Remove all uses of attribute "unused"
Awesome is built with -Wno-unused-parameter which means there is no point in
explicitly marking arguments as unused.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 18:19:15 +02:00
Uli Schlachter e5de0abfb4 Fix an unbalanced lua stack operation
luaA_init() left the global "package" table on the stack.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-23 16:18:14 +02:00
Uli Schlachter 11084c774c Handle errors in the config better
luaA_loadrc() now returns a failure when executing the config file causes an
error.
Previously it returned a success which meant the next config file wasn't tried.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-15 19:21:02 +02:00
Julien Danjou 220d072164 window: import class
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:27:42 +02:00
Julien Danjou 8966715b26 luaa: dump backtrace on panic
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-16 11:26:32 +01:00
Julien Danjou e3ba851692 spawn: disable signalfd in libev
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-14 09:55:29 +01:00
Julien Danjou c036ea5f3e globalconf: move conffile out
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-10 10:48:58 +01:00
Julien Danjou 2a73f6dd9d luaa: luaA_next is static
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 21:28:37 +01:00
Julien Danjou 31552f2122 font: remove draw_ prefix in names
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-27 12:16:22 +01:00
Julien Danjou 3ce7638e0f window: rename to xwindow
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou 371ee3e8cc titlebar: remove
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou e204473dfc client: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou 104e28778b tag: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou 86127a9f49 timer: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou 4c178d5441 hooks: remove
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou b2297fda46 globalconf: remove config.h include
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-07 17:28:55 +02:00
Stephen Sugden b6a066b040 Put homedir before /usr/share in lua search path
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-07 10:40:56 +02:00
Brian Gianforcaro 3145e3145e Grammar/spelling corrections in comments and docs.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-31 10:39:36 +02:00
Julien Danjou b83766b4c9 luaa: emit signal on runtime error
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 17:55:47 +02:00
Julien Danjou 3739aabda1 lualib: allow to replace error handling function
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 17:53:51 +02:00
Julien Danjou 0b3b13ba19 luaa: restart awesome on Lua PANIC
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 16:04:40 +02:00
Julien Danjou a6c4459a3a luaa: replace os.execute()
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 12:08:02 +02:00
Julien Danjou 4d0a025f51 luaclass: add handling of {new,}index of missing properties (FS#584)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou 3105663933 global signals use signal_object_emit
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou a02d026f77 client: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 84839d456d wibox: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou a916f2cd55 image: port to new class system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou dc61d258f0 luaclass: optimize type handling
We use lua_class_t pointer as key in the registry to store metatable we
will compare.
lauxlib uses a string, which sucks, because it forces to do a
pushliteral() each time you want to get a metatable from the registry,
which is slower.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 99b75bf486 tag: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 59c991ace0 widget: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 27fd05320e button: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:46 +02:00
Julien Danjou 04e55739fe key: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:46 +02:00
Julien Danjou 432f4229be timer: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-17 17:49:06 +02:00
Julien Danjou 84182466e0 spawn: move sn hooks to signals
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-17 17:47:55 +02:00
Julien Danjou ada6056c89 color: do not take pointer to push
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-17 17:46:35 +02:00
Julien Danjou 073e0377dd Revert "key, button: use as simple table"
This reverts commit d7454f4307.

Conflicts:

	button.h
	key.h
	lib/awful/titlebar.lua.in
	lib/naughty.lua.in
	wibox.c
	wibox.h
	widget.c
2009-08-14 16:48:52 +02:00
Julien Danjou 299bc00286 dbus: move to signal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 16:10:29 +02:00
Julien Danjou 284338532b luaobject: add type recognition
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:19 +02:00
Julien Danjou 706d545076 luaclass: register class in an array
That should permit class identification.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:19 +02:00
Julien Danjou eed9864ab0 luaobject: add signals
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 15:48:18 +02:00
Julien Danjou d7454f4307 key, button: use as simple table
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:44:54 +02:00
Julien Danjou a1b113901c luaobject: change global refering method
We now store elements in registry:
registry.pointer = userdata

And count references.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:40:51 +02:00
Brian Gianforcaro 404ec8eb24 Fix doxygen generation warnings.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-27 11:18:43 +02:00
Julien Danjou df20e95f82 color: move push color function to color.c
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-19 17:01:01 +02:00
Uli Schlachter 55524ece8d Use a libev prepare watcher for calling awesome_refresh()
Before this, awesome_refresh() could be called multiple times per mainloop and
one had to make sure to add awesome_refresh() calls in the right places.

Now, the prepare handler is invoked just before libev puts the process to sleep
(e.g. by calling select()) and awesome_refresh() does its thing.

All redundant calls to awesome_refresh() are removed, but the one in
selection.c has to stay because this function blocks in xcb_wait_for_event()
without using libev.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-19 09:34:42 +02:00
Julien Danjou e4acb74a5a luaa: split dofunction()
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:44:29 +02:00
Julien Danjou 3926f62ea3 hooks: remove arrange
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:44:00 +02:00
koniu f9311b1e00 hooks: add exit hook
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-08 11:38:52 +02:00
Julien Danjou 3f6ab274c0 wibox: all wiboxes go into one and only one array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:35 +02:00
Julien Danjou 1ef09fa8e6 luaa: add font_height in awesome module
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:17 +02:00
M. Dietrich 907a5379a3 fix loop over config files if none was found
if no file was found the string is just "\0" and neads a head
controled while

if no config file was found exit awesome with an error message
(fail early!)

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 10:21:16 +02:00
Ali Polatel 238dc06ae4 luaA_init: use Lua C API to add paths to package.path
This is cleaner and it should be a bit faster than using
luaL_dostring().

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-09 13:58:57 +02:00
Julien Danjou 3eb14d7c76 luaa: move version and release to awesome module
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-28 16:21:50 +02:00
Julien Danjou 85c5bffbcc luaa: use only one addsl
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 13:36:26 +02:00
Julien Danjou 9ac5cea397 luaa: optimize package path computing
This is just for fun.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 12:22:54 +02:00
Julien Danjou 39e907f5d8 luaa: refresh all wiboxes on font change
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 11:17:16 +02:00
Julien Danjou 0b61a38c7a luaa: use buffer rather than asprintf()
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-26 20:22:10 +02:00
Julien Danjou dc29720ef7 Replace lua_newtable() with lua_createtable()
Lua can preallocate space in table for array or non-array elements type.
This should improve performance when setting table, so when we can we
use lua_createtable() since this is just a gain.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-25 15:04:27 +02:00
Nikos Ntarmos 715f95555a libxdg-basedir 1.0.0 compatibility
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 18:51:04 +02:00
Julien Danjou 467737250c dbus: allow usage of the system bus
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 16:07:31 +02:00
Uli Schlachter 7f663ad563 Add luaA_pushcolor() for pushing color_t*
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter 99b521b2c7 Rename luaA_pushcolor() to luaA_pushxcolor()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Julien Danjou f473a107b0 cleanup #includes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:52:25 +02:00
Julien Danjou a415926b78 struct: move void_array definition to luaa
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:27:16 +02:00