The function selection() is now registered in the Lua global table from
selection.c instead of in luaa.c. This "feels cleaner" to me and is
preparatory for later changes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit adds the necessary method calls to setup the class and also
so that xfixes selection notify events can be handled. Currently, these
are empty functions, but later commits will fill them.
Signed-off-by: Uli Schlachter <psychon@znc.in>
From `kill(3p)`:
> If pid is greater than 0, sig shall be sent to the process whose
> process ID is equal to pid.
> If pid is 0, sig shall be sent to all processes (excluding an
> unspecified set of system processes) whose process group ID is equal to
> the process group ID of the sender, and for which the process has
> permission to send a signal.
> If pid is −1, sig shall be sent to all processes (excluding an
> unspecified set of system processes) for which the process has
> permission to send that signal.
> If pid is negative, but not −1, sig shall be sent to all processes
> (excluding an unspecified set of system processes) whose process group
> ID is equal to the absolute value of pid, and for which the process has
> permission to send a signal.
The documentation for awesome.register_xproperty, awesome.get_xproperty
and awesome.set_xproperty were lost in commit 26f15a13f3. This
commit adds them back.
Fixes: https://github.com/awesomeWM/awesome/issues/1817
Signed-off-by: Uli Schlachter <psychon@znc.in>
Up to now we assumed that the default config is in a path where
xdgConfigFind() finds it. However, evidently this is not always the
case, so make this explicitly try the default configuration file.
Fixes: https://github.com/awesomeWM/awesome/issues/1346
Signed-off-by: Uli Schlachter <psychon@znc.in>
Before this, there was a function which attempted to load different
configuration files in the right order. There was a boolean argument
that decided if we are actually loading it or just checking for syntax
error (for the --check argument of awesome). This lead to some
not-so-nice code since we do not want to fall-back to another config
when checking for syntax errors.
Refactor this so that there is now a function which calls a callback
function with the different paths that should be tried. This function
returns as soon as the callback function returns true.
Since just checking if the config syntax is ok does not depend on any
Lua state, an empty Lua state is now used for this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
It makes more sense to append the xdg config dirs to our list of
searchpath in awesome.c than in luaa.c. Plus, it simplifies some of the
following work.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This removes some @EXPANSIONS@ from Lua files and removes a hack that
was needed. All is better now! :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
* luaa.c: Remove useless stack operation
We get package.loaded and immediately throw away the result. That's
pointless, so remove this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
* Refactor modification of package.path
Awesome adds various entries to package.path during startup. This commit
moves that into a helper function. No functional changes intended. The
only change I did to the code was changing a call to lua_type(L, 2) into
lua_type(L, -1);.
Signed-off-by: Uli Schlachter <psychon@znc.in>
* Modify package.cpath just like package.path
This adds, for example, paths specified via the --search argument also
to package.cpath.
Fixes: https://github.com/awesomeWM/awesome/issues/1248
Signed-off-by: Uli Schlachter <psychon@znc.in>
This function should only be necessary for the test suite. It makes sure
that the X11 server received and handled all previous requests that
awesome sent. This will be needed, for example, in tests that use
root.fake_input().
After a call to awesome.sync(), we are sure that "faking input" has been
done and the next main loop iteration will handle the input event.
Without the sync, it could happen that the X11 server did not yet fake
the input in the next iteration.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Add a single "do" to the beginning of the config. This causes a parsing
error ("'end' expected") and then another warning saying "something was
left on the Lua stack.
Fix this by popping the error message where we need to do so.
Signed-off-by: Uli Schlachter <psychon@znc.in>
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The same effect could be achieved by modifying $LUA_PATH or with symlinks, but
having a special option to do this seems easier.
Note that the man page translations were generated via Google translate. I'm
looking forward to people submitting correct translations...
Inspired-by: https://github.com/awesomeWM/awesome/pull/485
Signed-off-by: Uli Schlachter <psychon@znc.in>
When a function is disconnected from a signal ("disconnect_signal") that is not
actually connected to the function, two things happened:
1. The attempt to remove the function from the signal array didn't do anything
2. Unreferencing the function noticed that the function wasn't referenced
The second step printed a big, fat scary warning.
Actually, this has the possibility of causing errors. For example, in the
following code, awesome would wrongly unreference the function at the
disconnect_signal() call and might later still try to call it when the
"refresh" signal is emitted:
do
local function f() end
awesome.connect_signal("refresh", f)
awesome.disconnect_signal("debug::error", f)
end
Fix this by making signal_disconnect() return a boolean value indicating if it
actually did something. All callers are fixed to use this value and only update
the reference counts if something was actually disconnected.
Fixes: https://github.com/awesomeWM/awesome/issues/814
Signed-off-by: Uli Schlachter <psychon@znc.in>
kill is a wrapper around the POSIX kill() function and unix_signal is a table
that maps signal numbers to their names and signal names to their numeric value.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This change catches things like c:geometry { width = -42 }.
Helps-a-bit-with: https://github.com/awesomeWM/awesome/pull/820 (fixes X errors)
Signed-off-by: Uli Schlachter <psychon@znc.in>
In various conditions, luaA_loadrc() left luaA_dofunction_on_error and an error
message on the Lua stack. Also, it used LUA_MULTRET without looking at the
return values. Fix all of this and reorder the code a bit to make it easier to
follow.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The only remaining calls are for a window's opacity and in the DBus type
handling. Everything else wants integers, not something with a comma.
Signed-off-by: Uli Schlachter <psychon@znc.in>
_NET_WM_ICON contains a list of icons and until now, the first one was
picked without regard to it's size. This adds a global option to set
the preferred icon size. When getting the client icon, the best size
match is picked. The size can be set via
awesome.set_preferred_icon_size() and the default is 0, which will pick
the smallest non-zero size icon available.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>