Commit Graph

1831 Commits

Author SHA1 Message Date
Aire-One bc822c0af7 Add all parameters from awful.prompt to awful.widget.prompt constructor. 2018-10-31 11:35:56 +01:00
Aire-One d5f20a7e0b Add `done_callback` parameter to awful.widget.prompt constructor. 2018-10-31 09:00:18 +01:00
Emmanuel Lepage Vallée 2458f127f3
Merge pull request #2360 from Elv13/add_awful_tag_layouts
awful.tag: Add awful tag layouts
2018-10-22 14:40:16 -04:00
Emmanuel Lepage Vallée aa16d77d15
Merge pull request #2423 from Elv13/better_rules_doc
Better awful.rules doc
2018-10-16 08:44:58 -04:00
Emmanuel Lepage Vallée 35130169c9
keygrabber: Rename release_event to stop_event (#2422)
In the earlier revision of the keygrabber PR, there was a `release_key`
and it was suggested to rename it `stop_key`. However its sibling
`release_event` wasn't, so it is now confusing.

The commit adds a mild deprecation codepath to avoid breaking configs
based on git-master. However it isn't a "long term" deprecation notice
and the code can probably be removed in 5.0 without further delay.
2018-10-16 08:42:56 -04:00
Emmanuel Lepage Vallee 990b1ddb9d awful.tag: Add a "tag centric" way to manage a layout list.
Previously, the layout list was global. However it wasn't covering all
possible use cases and make using `awful.widget.layoutlist` hard since
a layout could be excluded from the `awful.layout.layouts` but still
used for a tag (by setting it explicitly).
2018-10-15 16:10:18 -04:00
Emmanuel Lepage Vallee ae5fc042ae layout: Add a get_tag_layout_index function.
It helps check of the current tag layout is part of

    awful.layout.layouts
2018-10-15 14:21:24 -04:00
actionless 3cef72bb30 fix(awful: rules): don't raise every focusable client on awesome startup
re #2095
2018-10-14 20:41:45 +02:00
Emmanuel Lepage Vallee 43a82f34f0 doc: Add more examples about the spawn.easy_async
Ref #1373
Ref https://stackoverflow.com/questions/52634985/awesome-wm-os-execute-vs-afwul-spawn
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 845b9a930c doc: Refactor awful.spawn doc to have a property list. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b4e0363ac3 doc: Move the awful.rules to the header.
It's easier to find.
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b49f7e22dd doc: Add an index of valid properties to awful.spawn and awful.rules. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 90b17bdc09 awful.rules: Add proper documentation to the extra client properties.
Until now there wasn't much documentation available about how to use
these properties. With the new work on `awful.spawn` that rely more and
more on `awful.rules` integration, it is worth fixing.

This commit add a new documentation section and a future commit will
aggregate them to generate an index.
2018-10-10 01:58:18 -04:00
mergify[bot] 7020a9707f
Merge pull request #2421 from Elv13/fix_2419
Fix 2419
2018-10-08 16:46:46 +00:00
mergify[bot] 2f70fd6cce
Merge pull request #2409 from Elv13/spawn_once
A better run_or_raise/spawn.once/singleton API
2018-10-07 11:35:11 +00:00
Emmanuel Lepage Vallée 768184d152
Merge pull request #2368 from psychon/motif_hints
Add c.requests_no_titlebar based on motif hints
2018-10-06 22:00:03 -04:00
Emmanuel Lepage Vallee 789cf11d8d titlebar: Emit `request::titlebars` from `awful.titlebar`.
The toggle/show/hide function were incompatible with the current
`rc.lua` is `titlebars_enabled` was removed from the rules because
they were never created. This has always been the case but the
introduction os `request::titlebars` in Awesome 4.0 allows to solve
this longstanding issue. However until now it didn't.

Fix #2419
2018-10-06 18:46:50 -04:00
Alyssa Ross ee9670b1ea Gracefully fail when history file is inaccessible (#2410)
If the history file (or its parents) can't be created, running a command
will fail entirely. Since saving command history is not an integral part
of running a command, it would be nicer if it carried on, just without
saving history. This is what shells usually do.

This patch removes assertions in the history saving function and
instead adds an early return, so if the history isn't saved the command
invocation simply carries on.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2018-10-06 22:53:48 +02:00
Emmanuel Lepage Vallee 021a1feec8 awful.spawn: Add a `raise_or_spawn` method. 2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 0ac99a5dc5 awful.rules: Rename switchtotag to switch_to_tags.
First of all, it select many tags, so there is an "s". Also, Awesome
standardised naming to snake case in v4.0, but this was missed.
2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 927e7b2796 awful.spawn: Add an `once` and `single_instance` methods.
This commit adds a way to leverage the xproperty and startup_id APIs
to persist an execution token across restarts. It allows to use
`awful.rules` on clients that were executed by a previous Awesome
instance.

The main limitations of these methods is the lack of entropy used to
build the token. If the command is the same in multiple
`awful.spawn.once`, then it will not work as expected. To mitigate this
issue, the system try to concatenate the `awful.rules` table after the
command and hash the resulting string. Given rules are a table, it can
have loops and/or issues with keys ordering. The hash function sort and
limite recursion to prevent a stack overflow. Another issue is the
unreliability of startup notifications.
2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 9250610a77 activate: Add `switch_tag_tag` and `switch_to_tags`.
Also bring some consistency with `awful.rules` naming. A future commit
will add a `TODO v5` to resolve this naming issue.
2018-10-03 08:38:12 -04:00
Emmanuel Lepage Vallee 9e45e016e9 tag.viewmore: Add an optional limit to the number of selection. 2018-10-03 08:38:12 -04:00
Sergey Vlasov 61cdc40595 awful.placement: Fix no_offscreen when composed with other functions
The awful.placement.no_offscreen function did not work properly when
composed with other placement functions; in particular, the default
configuration (awful.placement.no_overlap+awful.placement.no_offscreen)
was broken.  The compose function sets args.pretend=true and puts the
result of the previous placement function into args.override_geometry
before calling the next placement function, but no_offscreen did not use
args.override_geometry, therefore the result of the previous placement
function was discarded.

All other placement functions use `geometry_common(c, args)` to get the
current client geometry; `area_common(c)` should be used only when
getting geometry of other clients.

This change also fixes the problem with margin handling (adding margins
should not affect the window size, only the window position should
change); the test output which was adjusted in commit 0275d3537d
is adjusted again to account for this change.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Sergey Vlasov db11c7e9da awful.placement: Fix client size corruption in no_overlap
The awful.placement.no_overlap function was adding the window border
width to the client width and height (this is performed in
area_common(), which is called by geometry_common()), but did not
reverse this operation by calling remove_border() before returning the
final geometry; because of this, using no_overlap resulted in increasing
the window width and height by 2*border_width.

The bug was probably introduced in commit ebcc19844e (before
that commit no_overlap changed the window position directly instead of
relying on the new placement infrastructure), but was not noticed
because of other problems (e.g., in the default configuration the result
of no_overlap was overridden by the buggy no_offscreen).

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Emmanuel Lepage Vallee 96bbbc82f3 widget.common: Add custom sources for the taglist and tasklist.
The current taglist/tasklist allow filter function to remove elements
from the list. However they don't allow sorting or additional entries
to be listed.

This commit introduced such a concept. It will later be used by the
layoutlist where it becomes more relevant since layouts are used created
"objects".
2018-08-27 00:03:22 -04:00
Uli Schlachter fa1728d749 Add c.requests_to_titlebar
This property is based on Motif WM hints and checks if the client
requests that it is not decorated with a titlebar.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 48d4a31b17 awful.rules: Support titlebars_enabled being a function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 3f958d60da Merge branch 'master' of https://github.com/mrschyte/awesome 2018-08-22 12:27:05 +02:00
Uli Schlachter 4d6920c165 Merge branch 'rules_tag_by_screen' of https://github.com/psychon/awesome 2018-08-22 12:26:37 +02:00
Uli Schlachter 674cd21b81 Merge branch 'second-try-no-offcreen' of https://github.com/actionless/awesome 2018-08-22 12:26:05 +02:00
Peter Kasza 016be728b1 Remove unsatisifiable condition when destination screen is empty
This commit fixes the following issue: https://github.com/awesomeWM/awesome/issues/2365
2018-08-21 13:19:02 +02:00
mergify[bot] 81da3a2ce7
Merge pull request #2358 from Elv13/add_filter_section
doc: Add filter section for the taglist and tasklist
2018-08-19 07:02:06 +00:00
Emmanuel Lepage Vallee 250475d65c widget.common: Use the new ldoc filter section. 2018-08-18 18:14:24 -04:00
Uli Schlachter 5b45442c73 Fix documentation of awful.menu.new
Fixes: https://github.com/awesomeWM/awesome/issues/2348
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 14:20:31 +02:00
Uli Schlachter ea98919f61 awful.rules: Also check for tag on other screens
When a tag is specified by name, awful.rules only searched for the tag
on the client's screen. This commit extends the search to all screens,
but only if no specific screen was specified for the new client by some
rule.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 09:44:29 +02:00
Uli Schlachter 8b5dd10f32 awful.menu: Fix typo "moue" -> "mouse"
The typo was introduced in commit a1941efc9.

Its effect should be minimal: :item_enter() itself does not care about
the 'mouse' option, but it forwards to :exec(). Here, an action is
invoked either if it was not caused by the mouse, or if it was caused by
the mouse and either auto_expand is enabled (which is the default), or
the item-to-be-executed is actually the active item.

In other words, it is quite non-trivial to come up with a case where
this typo made a difference. But of course that's no reason to leave the
typo in.

Fixes: https://github.com/awesomeWM/awesome/issues/2347
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-13 10:26:10 +02:00
Emmanuel Lepage Vallee efe82faf1c hotkey_popup: Use awful.keygrabber instead of capi.keygrabber 2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallee 2bf930b044 keygrabber: Refactor to be an object instead of a function.
The old keygrabber API wasn't doing what the users want from a
keygrabber module. With tons of boilerplate code, everything could
be done, but it wasn't trivial.

This commit add a default grabber function that implements the
keybinding API already used by `awful.key` and `awful.prompt`.

It also add syntax candy left and right to make the module "feel"
like a native CAPI object.

Nothing is perfect and some parts, like adding root keybindings, are not
vevy pleasing. However it fulfill its goal when it comes to make
previously non-trivial use case very easy to implement and deploy.
2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallée aab582c0a0
Merge pull request #2329 from Elv13/fix_minimize_activate
Fix 3rd party toolbar unminimization and the default rc.lua focusable issue
2018-08-03 18:07:50 -04:00
mergify[bot] b9e981ba63
Merge pull request #2327 from laszloth/master
Add a beautiful option to remove borders when maximized
2018-07-30 06:39:38 +00:00
Emmanuel Lepage Vallee 091adca070 activate: Merge the old hardcoded focus filter with awful.ewmh one.
This code was attached to mouse::enter in `rc.lua` instead of being part
of the unified request::activate architecture.

There is currently no way to detach this focus filter because it is
generally correct.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 26e4856821 activate: Raise unfocusable clients.
I am sure there is corner cases where this is considered wrong, but it
allows to simplify rc.lua handling of such clients.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 69e9cc4cbd request::activate: Unminimize clients
Fixes #927
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 3c79f1c8d5 awful.key: Add more fields to the description
There is currently no centralized way to manage active keybindings so
the description data case be used to fill part of that role until an
official API is added.
2018-07-29 10:45:40 -04:00
Laszlo Toth 647756fd15 Add a beautiful option to remove borders when maximized
No intended change in previous behavior, so it's disabled by default.
2018-07-28 16:06:57 +02:00
Daniel Hahler 3876b18240 doc: Add missing C-object documentation and fix some papercuts.
Ref: https://github.com/awesomeWM/awesome/issues/1373
2018-07-25 18:26:11 -04:00
actionless 492d07a9cd fixup! fix(awful: placement: no_offsceen): use new placement infrastructure
doc(awful: placement: no_offscreen): update comment and print deprecation warning
2018-07-25 14:31:51 +02:00
actionless fec8d6aa8f fix(awful: placement: no_offsceen): use new placement infrastructure
fix(tests: examples: awful: placement: no_offscreen): uncomment context

fix(awful: placement): common function to remove border from geometries
2018-07-24 07:38:35 +02:00
Yauhen Kirylau 94d3918d14 fix(awful: widget: only_on_screen): update for screen API changes from #2293 (#2304) 2018-07-22 18:33:59 -04:00