This meta-lua script takes the "raw" awesomerc.lua and turn it
into the final file and generate a documentation page from its
parsed content. It support
* Turn {{{ into markdown categories
* Turn top level comments into documentation
* Add custom documentation sections
* Parse the code to add links for each API calls
This helps generate a good entry point for new users wanting to
understand the content of rc.lua without searching the API by
hand.
Over time, this will also become the basis of the documentation.
If `rc.lua` is separated into several files, this will be easy to fix
this script. It could even do the separation itself from a monolitic
file using the already implemented {{{ parser.
run.sh waits for awesome's startup to be done by having awesome execute "return
1" via its dbus interface. However, by default dbus has a 25 second timeout
before it fails a dbus-send invocation. This defeats the purpose of this
exercise.
So instead of using awesome-client, this commit makes the code use dbus-send
directly and specifies a relative low reply timeout (which should still be
plenty so that this doesn't erroneously fail).
Signed-off-by: Uli Schlachter <psychon@znc.in>
The timeout utility guarantees an exit code of 124 when the process died due to
timeout. Since awesome only ever exits with 0 or 1, we can use this to reliably
detect timeouts and print a matching message.
Signed-off-by: Uli Schlachter <psychon@znc.in>
coreutils provides a timeout command. Use that instead of (badly) inventing our
own version of it. This "timeout" command seems to be new. Let's hope everyone
has it and think about alternative solutions only when needed.
Fixes: https://github.com/awesomeWM/awesome/issues/1075
Signed-off-by: Uli Schlachter <psychon@znc.in>
When awesome exits with a non-zero code, this is something interesting that we
should log. Do so.
The "set +e" / "set -e" dance is required so that we do not abort because the
wait builtin returns a non-zero code.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This script runs under "set -e", so any command exiting with a non-zero status
makes it abort. However, we do not care about failures from grep to find
anything, so handle that case gracefully.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes the function only call client_ignore_enterleave_events() when
it actually has to. Since we expect that most of the time, no client's geometry
is changed, this means that most of the time this function is not called.
Fixes: https://github.com/awesomeWM/awesome/issues/1107
Signed-off-by: Uli Schlachter <psychon@znc.in>
Twice now we had problems with the garbage collector which caused signals
established via weak_connect_signal() not to be disconnected when we wanted them
to be disconnected. The effect was that we tried to redraw a drawable after it
was garbage collected which caused errors.
Instead of playing whack-a-mole with all the various ways that might make us
redraw a drawable after GC, let's just fix all of these issues by explicitly
checking for this case and turning it into a no-op.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Before this commit: When we are GC'ing an object, we clear its metatable, since
otherwise crashes could occur in various places. This means that if someone
tries to use such an object, they get an unhelpful error message like "attempt
to index userdata object" and they don't understand what the problem is. Also,
this means that foo.valid does not actually work after GC.
This commit changes this behaviour. Instead of setting an empty metatable, we
now create a metatable with an __index and __newindex method. These metamethods
produce better error messages that they sat the underlying object was already
garbage collected. Better yet, the __index metamethod makes foo.valid be false
instead of causing an error, so that the existing machinery for detecting
invalid objects continues to work.
This commit also adds a functional test that verifies this behaviour.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The previous commit made wibox.drawable turn a "normal redraw" into a complete
repaint when it was moved to another screen. However, nothing happened until
that normal redraw.
This commit triggers a normal redraw when we are (possibly) moved to another
screen. More precise, this means that whenever a screen appears, disappears or
changes its geometry and when the drawable is moved, we trigger a normal redraw.
This redraw will likely do nothing, because no relayout is pending and no part
of the surface needs a redraw, so it is cheap.
However, if the drawable really ends up on another screen, then the code from
the previous commits makes us do a full relayout and redraw.
This commit likely fixes the current instability of test-screen-changes.lua. See
https://github.com/awesomeWM/awesome/issues/982#issuecomment-231712056.
As explained there, the test fails because the fake screen that it created is
still referenced, so cannot be garbage collected, but the test doesn't succeed
unless the screen is garbage collected. So something is still referencing the
screen that was removed. This something can be a client's titlebar, because the
underlying drawable still has a context member referring to the old screen.
This commit should fix that problem, because we now trigger a redraw which will
compute a new context and thus the reference to the old screen is released.
Signed-off-by: Uli Schlachter <psychon@znc.in>