Commit Graph

356 Commits

Author SHA1 Message Date
Gerome Matilla 158cc37a0d
Apply placement margins on awful.tooltip (#3053)
Co-authored-by: Gerome Matilla <gerome.matilla@gmail.com>
2020-04-01 02:13:58 -07:00
hung 4eff88679c new shape: star 2020-03-28 20:21:39 +07:00
Seth Barberee 6d24dc2ab7 add example for master_count 2020-03-20 01:00:53 -05:00
Emmanuel Lepage Vallée dd289e5ab2
Merge pull request #2853 from Elv13/notif_rules
Add the notification rules.
2020-02-22 18:48:27 -05:00
Seth Barberee b3766c0544 add two examples for awful.wibar 2020-02-20 04:51:44 -06:00
Emmanuel Lepage Vallee 2d477383ee tests: Test the notification rules. 2020-02-15 20:33:21 -05:00
Emmanuel Lepage Vallee ee80fe052f init: Add an API level concept to `capi`.
The API level concept is something used by other projects such as
Android and iOS to allow deprecated features to be removed and the
bahavior to be altered without breaking compability with existing
code.

The same will apply to AwesomeWM. The current API level is "4" and
as long as config use this, no deprecation or bahavior change will
be exposed. If the user sets it to an higher value or we release
the next major version and new users start to use the, then current,
default config, they will use the new API level.

The the far future, if ever, we could fork the entire Lua libraries
to support legacy APIs. This would only require to keep the core
API support for those legacy calls. In the meantime, `gears.debug`
will use this to manage the deprecation and some conditional code
will be added as a last resort attempt to preserve behavior
compatibility while moving forward with breaking changes.
2020-02-08 17:18:01 -05:00
Emmanuel Lepage Vallee 20743a9a16 Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
Emmanuel Lepage Vallee 171a14dbc8 tests: Port the hardcoded awful.rules test to the sequence template. 2020-01-19 02:58:41 -05:00
Seth Barberee ab6381686e add calendar_popup pic to doc 2020-01-17 16:02:18 -06:00
Emmanuel Lepage Vallee 6b427e73a8 tag: Add a request::layouts signal and append/remove layout. 2020-01-11 15:43:31 -08:00
Emmanuel Lepage Vallee 5818de41ce awful: Rename awful.ewmh to awful.permissions.
It has nothing to do with EWMH since a long time. It was already used
for the requests, so lets formalize this.
2020-01-11 15:43:30 -08:00
Emmanuel Lepage Vallee 04c757322c client: Turn `rc.lua` logic into a new `request::border` signal.
The default `rc.lua` was using the focus/unfocus signals to set
the border color along with `awful.rules`. This logic block was
no longer aligned with the rest of `rc.lua` since it was
the only place where `beautiful` variables where only used by
`rc.lua`.

On top of this, the new request handler also has extra contexts
for the urgent and floating/maximixed use cases. So it can be used
by themes to implement much smarter borders than just focus based
ones. They were previously limited by the fact most of the
(un-monkey-patchable) logic was in `rc.lua`.

Note that this commit also shuffle the awful.rules order between
the titlebar and the border and changes the tests accordignly.
After some consideration, I came to the conclusion the previous
behavior was bogus and the fact that the placement tests required
to know about the titlebar height is simply a proof of that. The
change was required in this commit because since the border is no
longer in the default rules, a new buggy edge case surfaced.
2020-01-11 15:43:11 -08:00
Emmanuel Lepage Vallee 067bcaca60 client: Rename the `manage` and `unmanage` signals.
They currently fit the general concept of a `request::` in the sense
that they are not property related and have "request handlers".

The commit also add deprecation for signals.

The reason for this fits within the larger standardization project.
Non-namespaced signals will eventually be renamed. This has started
a long time ago.

What is old is new again. Once upon a time, there was a `startup`
parameter to the `manage` signal. It is now back in the form of
a context.

Finally, this commit removes the `manage` section of `rc.lua`. It no
longer did anything worthy of being in the config. Each of its
important parts have been moved out over the years and the last
remaining bit is always required anyway. The code has been moved
to `client.lua`.
2020-01-11 14:43:56 -08:00
Seth Barberee b9bb9cbe69 add docs for gears.cache 2020-01-05 20:58:36 -06:00
Seth Barberee d05b7d80f1 gears.string doc revamp 2019-12-19 09:52:03 -06:00
Seth Barberee 9e3c418a03 add gears.table.cycle_value (#2942) 2019-12-12 22:10:10 -08:00
Emmanuel Lepage Vallee 90ddbb9cd0 doc: Add `local` in the launcher example.
It caused some versions of luacheck to bark.
2019-12-05 23:51:00 -05:00
Seth Barberee 431791accc add layoutbox example 2019-12-05 23:48:55 -05:00
Seth Barberee 7440cf66f0 more docs for launcher (#2935)
Co-Authored-By: Aire-One <Aire-One@users.noreply.github.com>
2019-12-04 00:08:40 -05:00
mergify[bot] a0386dad91
Merge pull request #2921 from Aire-One/doc_fix_modules_summaries
[Draft/Proposal] DOC - Fix modules summaries.
2019-11-29 06:22:34 +00:00
Aire-One 3e6c33af64 Add imagebox doc example for `resize` property. 2019-11-28 13:53:59 +01:00
Aire-One 86a9bbfd71 Improve the `wibox.widget.imagebox` descrition.
* Add a better descrition for the `imagebox` role in the wiboxes system ;
* Improve image + code render and integration into the descrition ;
* Add a second code exemple to show both coding style (imperative and declarative).

I think the user can now have a better overview of what's a `wibox.widget.imagebox` and how to use it.
2019-11-28 13:53:59 +01:00
Aire-One fcc3d0b590 Add an option to draw clients.
Change how wibox are drawn to build a more flexible function reusable in the context of clients.
Add `clients` option to the template. This new option needs an associative table `{ ['label'] = client }` to work. Where label will be a text rendered on the middle of the client area.
Add a new example: `texts/examples/screen/tiled_clients.lua`.
2019-11-28 13:31:21 +01:00
Aire-One 3791daaeaf Add wibar drawing to screen properties images. 2019-11-22 14:40:21 +01:00
Aire-One 92f698bbae Add an option to draw the wibar on screen images.
Add a new option to the screen image template: `draw_wibar`.
This option draw the wibar on the generated image.
2019-11-22 14:40:21 +01:00
Aire-One 3830e9de35 Invert rulers insertion order.
Rulers insertion order impact the result of the bubble sort algorithm.
By inverting the order, we can make the output image looking more natural.

Awesome's screen properties can be seen like this:
* The screen has a geometry (its size) ;
* Inside there is the workarea ;
* Inside there is the tiling_area.

It seems better to draw rulers in this order.
2019-11-22 14:39:52 +01:00
Emmanuel Lepage Vallee ee331a4eff keygrabber: Remove the hardcoded way to add keybindings.
There is now a real API for this.
2019-11-09 16:43:53 -05:00
Emmanuel Lepage Vallee afbb3b7faf shims: Add the legacy _keys and _buttons to the client shims. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee f4cfb99cde shims: Update the `button` and `key` shims to be objects.
Now that something actually tries to set the index handlers, it
cannot be a dumb function anymore.
2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 45823f230a capi: Move from `.data` to `._private` for the property data.
This will bring the CAPI classes closer to the gears.object ones.

Fixes #2897
2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 4501f0e768 Allow to add and remove keys and buttons.
Another step in moving these APIs toward the common object oriented and
declarative paradigms used by other APIs.

This commit introduces the `awful.keyboard` module. It currenly only
exists as a placeholder for the first few append/remove function, but
will grow in scope in another pull request to expose the currently
private modifier APIs and to provide keybindings collision detection
and replace some of `awful.hotkey_popup` business logic.

The `keygrabber` tests which uses root keybindings are disabled for
now to keep the commit size small. This is necessary since the shims
will need many iterations of changes before this work again with the
new syntax.
2019-11-09 16:42:06 -05:00
Emmanuel Lepage Vallee cbb90d8bd1 root: Turn `root.keys()` into a property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 296ad18922 client: Move the `c:keys()` method to a property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 29e804a4f8 drawin: Turn `:buttons()` into a property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee d5dd3fc794 tests: Test root.buttons
Try both legacy and standardized code paths. Also try invalid mixes of
them in case some modules abuse of rc.lua and ingest the wrong format
by accident.
2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 141aca2432 root.buttons: Move to Lua.
This is the groundwork commit to support using `awful.button` objects in
`root.buttons`.
2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee b1c81c4258 awful: Set a miss handler for capi.root
There is no better place to put it and need to always be required
for backward compatibility. Given Awesome no longer works properly
without `awful`, I put the code there.
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallee 95500ea71c root: Add support for setting a miss handler.
This will allow to port some functions from C to Lua, such as supporting
`awful.key` directly when setting the buttons.
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallee 3aafa64ea7 tests: Import the backward compatibility API for all the tests.
This isn't very nice and pulls all sort of almost useless code into
the shims, making them less atomic. However the next few commits
will start another round of API standardization and the compatibility
layer wont be optional anymore.
2019-10-05 18:06:50 -04:00
Aire-One dd69936bed Add a `gen_vertical_space` function to keep spacing from missalignment. 2019-10-05 17:16:22 -04:00
Aire-One 4abb05c590 Align timeline dots and text. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallée ffe7c4d1cc Apply suggestions from code review
Thanks to @Aire-one for those fixes!

Co-Authored-By: Aire-One <Aire-One@users.noreply.github.com>
2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee c2a2c789e6 doc: Add example sequences for the tags. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee fa2433192a doc: Add some screen example sequences. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee 271e2822a7 build: Allow Awesome to be built with luarock LGI. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee 9c0e16e623 doc: Add examples for the various maximization. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee 12f28305a0 tests: Add a sequence template.
This template allows to display a sequence of events for the clients,
tags and screens. Currently, it is hard to display images where the
state of an object is more complex than "here how it was before" and
"here how it is now". With this template, it is possible to have a
timeline of events from the initial states to the final states.

Now, as the line count shows, this isn't small. It is in fact an
enormous template. Worst still, this commit is the first *half* of
it. The second half adds the ability to `print()`, display
inline code and support mouse and keyboard events. The code also isn't
world class. Maintaining this template might be non-trivial in the
long run. I am fully aware of those issues. On the other hand, there
is ~100 places where this will be used once the entire
"new rule library" project is completed. This will bring the ~1.2k
line of code to ~12 lines per consumer. From that point of view,
it makes a lot more sense to merge this given how useful it is
at explaining changes within the "core objects".

It is also important to keep in mind that there is currently very
little or no documentation (beside the mandatory one-liner summary)
for these concepts. Those are the most important aspects of AwesomeWM
API and they are the least documented. This is just wrong.
2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee 6b4b09adc5 doc: Fix the UML template svg generation.
It was mixing the actual HTML relative path with the build directory
path. This doesn't work universally. It didn't work on `awesome-www`
builder.
2019-10-01 02:07:05 -04:00
Emmanuel Lepage Vallée 85c8d5e205
Merge pull request #2854 from Elv13/uml_magic
Add some navigation helpers to the doc (in the form of UML tables)
2019-10-01 00:56:20 -04:00
Emmanuel Lepage Vallee 994034934e tests: Test `s:split()`. 2019-09-29 19:07:24 -04:00
Emmanuel Lepage Vallee 53fc364ede shims: Update to handle Lua-side screen managment. 2019-09-29 18:20:15 -04:00
Uli Schlachter 0bc22aea85 client shims: Remove some duplicate code
Both commit 44e6b2d24e and 4eda67ce54 added the same function to this
file (and by the commit message, the later was intended to do so, while
the former has an unrelated commit message (but does not contain any
other changes)).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-09-21 13:44:38 +02:00
Emmanuel Lepage Vallée f1335be21a
Merge pull request #2855 from Elv13/screen_geo_template
doc: Add some images to represent the various area of a screen.
2019-08-25 15:48:18 -04:00
Aire-One d97dccfa1f doc: Improve the screen padding image.
It now shows the padding instead of the tiling area.
2019-08-25 15:35:17 -04:00
Emmanuel Lepage Vallee 602d6ded07 doc: Add some images to represent the various area of a screen. 2019-08-19 01:48:00 -04:00
Emmanuel Lepage Vallee f0bf0df6f0 doc: Add an UML class diagram like table of cardinalities.
It will help users find how to get some objects from other objects.
2019-08-19 01:19:32 -04:00
Emmanuel Lepage Vallee c48b03ca9c doc: Help the examples with text but no images get generated more often.
In case of error, well, make an error, but update the content anyway.
This will be enough for the CI but makes development less painful.

Also update the cmake targets to re-generate them more often.
2019-08-19 00:24:14 -04:00
Emmanuel Lepage Vallee 6cb54db6c1 tests: Fix tag:clients() in the shims 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 84a0ca56a2 tests: Implement dynamic properties for the client shims.
This way enough signal are sent to display clients modified by the
rules.
2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 9283719bfb tests: Implement the fake_* screen methods 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee f0b6e36ac1 tests: Implement mouse.screen properly 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee e8c1463ce3 tests: Compute root.size() cxorrectly 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 4eda67ce54 tests: Add the struts to the shims 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 44e6b2d24e shims: Always return something for c:tags() 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 48f973f2eb tests: Add awesome.xrdb_get_value to the shims 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee ef508462b8 shims: Add a better error message when mouse.screen is called too early. 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee d3a0dcffcd tests: Add client:kill() to the shims. 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee a18348542c shims: Enforce working on valid screen objects.
Previously it was possible to manipulate deleted screens and that
made debugging harder down the line. By catching this early, it
wont be as nightmarish.
2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee ce2dbea510 shims: Avoid a race condition when setting the mouse screen. 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee f7c0f419e9 shims: Fix indentation 2019-08-14 00:55:27 -04:00
Emmanuel Lepage Vallee 1617c894cc tests: Use rawget to avoid trigerring the tripwire.
The next commit will introduce extra checks that would otherwise
break this.
2019-08-14 00:55:27 -04:00
Emmanuel Lepage Vallée 1e59fc7fd2
Merge pull request #2828 from Elv13/matcher_v2
Improve `gears.matcher` to be more flexible.
2019-08-11 22:29:35 -07:00
Emmanuel Lepage Vallée c4c97174e6
doc: Fix a rendering regression regarding backgrounds. (#2820)
The way background are rendered changed to accomodate issues regarding
cliping and border. However this broke the documentation examples.

This commit fixes this in the least hacky way I found.

Fixes #2727
2019-08-06 22:48:06 -07:00
Emmanuel Lepage Vallee 91ca922671 tests: Test the gears.matcher greater and lesser sections. 2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 2dc8c62b9b tests: Test gears.matcher "rule_every". 2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 774465df4d doc: Add the new grears.matcher features to the lone example.
This isn't really intended to be used outside of the object rules.
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallée f3ee880bd8
Merge pull request #2816 from Elv13/more_notif_fix
Fix 4 "new API" notification bugs
2019-07-10 17:27:27 -04:00
Emmanuel Lepage Vallee aabbb412fe naughty.action: Fix icon_only.
It could not be specified in the contructor.

Fix #2815
2019-07-07 16:07:37 -04:00
Uli Schlachter fe37eeb913 Fix index handling in a taglist example (#2810) 2019-07-03 16:54:42 -04:00
Emmanuel Lepage Vallee c97cb5c282 tests: Test the new naughty.widgets
This commit also add some "magic" comments to existing tests so they
render correctly. Note that some older commits predates these "magic"
comments, which is why they are not there.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee b4ece0f053 doc: Use an explicit tag for all static functions.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.

This commit also fixes a large number of issues found while
proof-reading everything.
2019-06-08 18:14:13 -04:00
Michael Beaumont 9e2a544ba3 naughty: Add position "middle" to center notifications in screen (#2775)
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
2019-06-08 16:10:14 -04:00
Hùng 755c44ca52 Slider new feature `bar_active_color` and examples
- Fill slider bar with a linear pattern based on current value (if `bar_active_color` and `bar_color` are correctly provided)
- Add examples for the apidoc
2019-04-23 23:13:32 -04:00
zsugabubus 7c54e1cbf2 tests/examples: Fix minor typo in vimode.lua (#2755) 2019-04-23 23:12:20 -04:00
Emmanuel Lepage Vallée df0cdbed61
Merge pull request #2600 from Elv13/extract_rules
Extract the awful.rules logic into a gears module
2019-04-15 13:28:48 -04:00
Emmanuel Lepage Vallée 63e7c68b6c
Fix the broken test due to the "soft" merge conflict of two notification pull requests. (#2751)
* naughty.legacy: Fix a regression caused by a prior fix.

The title was only set "later" because it was called too early.

The intended result was to prevent the code from being executed when
there is no leagcy popup, but it had this side effect.

* naughty.dbus: Expose the new "private" methods so they can be tested.

Because it now uses Gio instead of capi.dbus, it isn't possible to
just shim the backend anymore.

* shims: Upgrade the dbus shims to also emulate some Gio behavior.

As usual, it is the most basic version that produces the correct
result. It doesn't try to comply to the real API.
2019-04-15 13:07:53 -04:00
Uli Schlachter 8218c30a84 Improve the error message for the current breakage (#2749)
The tests for naughty are currently broken, because naughty.dbus now
uses Gio for interacting with DBus, but the tests still try to use
awesome's dbus object. Turn the resulting weird error into something a
lot less cryptic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-04-14 13:44:05 -04:00
Emmanuel Lepage Vallee a081413339 tasklist: Auto-call set_client on all template widgets
This commit also update one of the example to remove its now
redundant boilerplate code.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee d5a06b0c68 tests: Share the "default look&feel" boilerplate code among the tests.
This will avoid some copy/paste in future tests.

The commit also fixes a typo and a missing --DOC_NO_DASH which breaks
rendering with one of the markdown implementation.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee fe10119933 tests: Test the notifications. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 441c4ae98c tests: Add a notification template. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee eb1c45b656 background: Update all users so they don't use the deprecated name.
This is done before deprecating the API so no commit ever use the
deprecated name.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 59e2ae6800 shims: Set capi.screen.primary.
This is used as a fallback when some objects go out of screen.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 0c53d76f25 shims: Emit property::geometry when resizing screens.
It allows to wibars to be resized.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 6aabb73fa3 shims: Implement signal forwarding.
This make the rules, among other things, work.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee be72b4033a shims: Prevent a potential stack overflow in the client shims. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 8111495c88 shims: Set the client metatable earlier.
Once the signals get propagated, it means "manage" will call code before
the metatable is set. If this happens and it sets some properties, they
will perpetually bypass the `awful.client.object` handler.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 936040a283 shims: Add disconnect_signal.
It is necessary when adding many wibars.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 7997549067 shims: Do not select all tags by default.
It will now behave closer to the default config.
2019-04-05 21:06:11 -04:00