Commit Graph

7762 Commits

Author SHA1 Message Date
Daniel Hahler 2e97b68dac Merge pull request #1062 from psychon/use-awesome-client-arguments
Make use of awesome-client commands
2016-09-02 18:13:32 +02:00
Daniel Hahler c2755cbde9 Merge pull request #1063 from psychon/getopt_errors
Getopt errors
2016-09-02 18:12:49 +02:00
Uli Schlachter cf89f108ac Make use of awesome-client commands
This uses the new support introduced in f0f31bc305 in the docs and in
tests/run.sh, removing an useless use of cat/echo.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 17:45:37 +02:00
Uli Schlachter 4ce16084ff awesome-client: Handle errors when running arguments
Commit 78abb4a54c made awesome-client fail with a
non-zero exit code when sending a command that it got from stdin failed.

Commit f0f31bc305 added the possibility to specify
commands to run as arguments to awesome-client. However, the exit code was still
zero even when such a command failed.

This commit makes awesome-client signal errors with its exit code even for code
specified via arguments.

Note that this means that following arguments will not be executed if some
argument fails. I do not know if this is the best behaviour or not, but I am
implementing it like this here due to its simplicity to implement.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 17:44:43 +02:00
Uli Schlachter e1d5c0c925 Do not allow multiple --config arguments
Otherwise there is a small, unimportant memory leak. More important is the fact
that later such flags overwrite earlier flags.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 13:31:16 +02:00
Uli Schlachter 4cbf87b441 Remove empty-argument checks
This code removes code which could only be hit be running awesome --search '' or
awesome -c ''. In both cases there are many possibilities for weird/invalid
arguments and I don't see why the empty string deserves special treatment.

Note that awesome --search does NOT hit this code, because getopt_long handles
the case of "completely missing" arguments itself.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 13:27:07 +02:00
Uli Schlachter fd90061c24 Make argument parsing errors fatal
When you run "awesome --foobar", a warning will be printed (by getopt_long())
and awesome just ignores the invalid argument. That's unusual and weird.

This commit produces an error instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 13:26:28 +02:00
Emmanuel Lepage Vallée 08e4c304cd client: Fix a potential crash due to a race condition. (#1055)
If raise was called from the awful.rule `manage` callback at
startup with a client already present it crashed due to a
buffer underflow.
2016-08-30 12:59:45 +02:00
Fernando Vezzosi f0f31bc305 awesome-client: send command line arguments to awesome (#1058)
In some languages, invoking commands with command-line arguments is
significantly simpler than setting up pipes for writing to a command's
standard input.

This adds an additional way for sending commands through awesome-client;
so all of these will be equivalent:

  $ awesome-client 'awesome.restart()'
  $ echo 'awesome.restart()' | awesome-client
  $ awesome-client <<<'awesome.restart()'
  $ awesome-client
  awesome# awesome.restart()
  awesome# ^D
  $

Note that this sends each command line argument as a separate message
over dbus.
2016-08-30 12:58:54 +02:00
Emmanuel Lepage Vallée 83e0423e89 tooltip: Stop using a fallback font (#1061)
Let the default font be used, just as everywhere else.
2016-08-30 12:57:40 +02:00
Emmanuel Lepage Vallée 68aae5ff62 Merge pull request #1051 from Elv13/fix_tag_index
tag: Fix index calculation.
2016-08-22 18:09:03 -04:00
Emmanuel Lepage Vallee 01db39f5bb screen: Use math.huge instead of 9999 2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallee f2bb0ab871 tests: Test the tag index more often 2016-08-22 17:27:48 -04:00
Daniel Hahler 99657f49cf Travis: pin ldoc at 1.4.4
Ref: https://github.com/awesomeWM/awesome/pull/1051#issuecomment-241327733
2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallee bbfa6006f3 tag: Fix index calculation.
The index was updated on an unordered table. As the elements
order did not match the relative indices once they have been
changed, further calls to set_index produced garbage.

The default taglist didn't notice because it use screen.tags
table index instead of the tag index. A debug using

echo 'for _,t in ipairs(mouse.screen.tags) do
  print("INDEX:", _, t.index, t.name) end' | awesome-client

Would have shown two or more elements with the same index. To
debug issues related to tag indices, this bash script can be
enabled:

while true; do
  echo 'for _,t in ipairs(mouse.screen.tags) do
  assert( _==t.index) end' | awesome-client
  sleep 0.5
done
2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallee 99489584cc doc: Fix a typo (Disonnect -> Disconnect) 2016-08-21 04:28:59 -04:00
Emmanuel Lepage Vallée ba2750cf91 Merge pull request #929 from Elv13/geometry_overhaul_p3.03
Geometry overhaul part 3.03 (final part for 3.6)
2016-08-20 16:40:36 -04:00
Emmanuel Lepage Vallee 4aada37682 tests: Test tooltips 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 2088ca26e8 tooltip: Support generic properties in constructor 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee bc3cbc44c9 tooltip: Add position mode 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 141b191921 tooltip: Add shape support 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 8468d06350 placement: Port next_to_mouse to the new API 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ea52b199c6 tooltip: Add align support 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ade3fabaa9 tooltip: Make the 'visible' property dynamic 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 2910a007df tooltip: Turn into a class
As done with everything else
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 211907def2 placement: Add `next_to`
This commit add the last placement function imported from the
Radical module.

It allows to place a wibox/client next to another object. It tries
to find the best fit. It also support wibox widgets.

This is intended for tooltips and menus, but can also be used in
`awful.rules` to place the new client as close as possible to the
focused one without overlap.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ce5cdb49ed mouse: Add the current_widget_geometry property
Apparently, __index cannot return multiple values, so the previous
code wasn't working.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallée 76d0c458b0 Merge pull request #1031 from Elv13/add_recursive_signal
Add recursive signal for widgets trees.
2016-08-20 16:01:54 -04:00
Emmanuel Lepage Vallee 732b170cb0 doc: Fix the awful.widget.button documentation
It was missing the macros.
2016-08-20 15:41:12 -04:00
Emmanuel Lepage Vallee 46f6d28bdf tests: Test recursive signals on mouse events. 2016-08-20 15:41:12 -04:00
Emmanuel Lepage Vallee 370d333590 widget: Add recursive signals.
This allows to ignore containers and layouts when a signal is sent.
2016-08-20 15:41:12 -04:00
Uli Schlachter c22b939630 Be less strict about warnings from "example tests" (#1045)
The build is no longer aborted when one of the "example tests" produces a
message on stderr. However, on Travis this requirement is still made. This
should catch "bad errors" via Travis while not breaking the build for users.

Fixes: https://github.com/awesomeWM/awesome/issues/821
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-20 18:59:28 +02:00
Daniel Hahler 63c8a310d0 doc: fix missing parenthesis with client examples (#1046) 2016-08-20 18:59:01 +02:00
Daniel Hahler e723d183e8 Merge pull request #1011 from psychon/commandline-search
Commandline option to add a directory to Lua's search path.
2016-08-20 18:58:11 +02:00
Uli Schlachter 71049a67f7 tests/run.sh: Use --search instead of $LUA_PATH
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-20 16:04:11 +02:00
Uli Schlachter 24bb38969d Add an option to add a path to $LUA_PATH
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>
2016-08-20 16:04:11 +02:00
Uli Schlachter f95449a4bb man pages: Update synopsis
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-20 16:04:10 +02:00
Emmanuel Lepage Vallée cbda387677 Merge pull request #1008 from blueyed/tests-run-from-tests-dir
tests/run: change to script dir first
2016-08-20 00:15:57 -04:00
Emmanuel Lepage Vallee ec923e96fc layout: Add more signals. 2016-08-17 02:31:16 -04:00
Daniel Hahler 23ad19d988 travis-apidoc.sh: remove misleading comment
Apparently a leftover when it was in .travis.yml, but it still makes
sense to use those env vars instead of calling `git-confog`, which is
not stateless.

[ci skip]
2016-08-15 17:37:54 +02:00
Daniel Hahler 65e8b9c36b Travis: fix return/exit usage (#1043)
Return 0 (success) in do_codecov function.  It is used in "&&" chains,
and should just do nothing for "coverall", but not break it.

This also makes use of "set -ev" instead of "exit" in general.

The "exit" caused the whole build to stop, but it was still green!
https://travis-ci.org/awesomeWM/awesome/jobs/151943526

"exit" is not really supported:
https://docs.travis-ci.com/user/customizing-the-build/#How-does-this-work%3F-(Or%2C-why-you-should-not-use-exit-in-build-steps)

This also wraps (most of) the "cd" commands in a subshell, to ensure
being in the repo directory all the time (except for $BUILD_IN_DIR).
2016-08-14 02:25:20 +02:00
Emmanuel Lepage Vallée 40b1a99980 Merge pull request #1041 from Elv13/fix_1039
Fix #1039
2016-08-13 14:22:46 -04:00
Daniel Hahler 0d1331e592 Travis: allow failures with LuaJIT (#1025)
This is not nice and we should still try to fix it, but it seems better
to have green PRs without triggering a rebuild etc.

See https://github.com/awesomeWM/awesome/issues/982#issuecomment-231522318.
2016-08-13 00:21:33 +02:00
Emmanuel Lepage Vallee 9d69448ac1 tests: Test mouse.move on odd sized clients.
Close #1039
2016-08-12 17:02:33 -04:00
Emmanuel Lepage Vallee 19d4a3f602 placement.under_mouse: Fix a rounding error.
When object size contains odd numbers, the result was +1px off.
2016-08-12 17:02:33 -04:00
Emmanuel Lepage Vallée e3c24c8e09 Revert "screen: Fix potential nil index" (#1037)
This reverts commit facf676b13.

Using capi.client.focus.screen to decide which screen is focused breaks
a multiscreen setup. At least makes it extremely annoying to use.

In particular, if you have a focused client on screen 1, move the mouse
to screen 2 and launch a new client, the new client appears in screen 1,
since screen.focused reports that current focused screen is 1, not 2
because of the focused client.

Close #1035
Fix #1029
2016-08-11 19:03:17 +02:00
Emmanuel Lepage Vallée 03dc4767d5 Merge pull request #1036 from cmertz/master
remove client.jumpto deprecation warnings
2016-08-10 12:17:49 -04:00
cmertz f5f8998d0c use c:jump_to instead of client.jumpto 2016-08-10 13:02:02 +02:00
Emmanuel Lepage Vallée 4ef524d76e Merge pull request #1034 from Elv13/fix_spawn_crash
spawn: Fix crash when called with an empty table.
2016-08-09 19:13:18 -04:00
Emmanuel Lepage Vallee da62aec055 tests: Test spawn empty command corner case 2016-08-09 18:50:34 -04:00