Commit Graph

37 Commits

Author SHA1 Message Date
Ignas Anikevicius (gns_ank) 12185a5aae Docs: Port awful.rules into the new doc format.
This converts the old documentation style into the new one to use
markdown instead of HTML in bigger doc blocks. Also, we can use block
comments, which means that writting documentation (and indenting code
blocks) easier.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Daniel Hahler 289bc26a3c doc: config.ld: setup @client alias, and use it
It also adds the "@tab" alias, which did not work for me, but should be
the default?!
2015-02-15 22:33:23 +01:00
Daniel Hahler 76ede0ef45 Revert "awful.rules.execute: use delayed_call for emitting request::activate"
The 'request::activate' signal should be sent and handled immediately,
and not delayed.  It was too much of a hack to work around the client
not being visible.

Instead, the "is visible" constraint on `capi.client.focus` will be
removed.

This reverts commit 6963ede3dc.
2015-02-14 14:30:04 +01:00
Daniel Hahler 6963ede3dc awful.rules.execute: use delayed_call for emitting request::activate
This is a followup to commit 90fde13, which caused the client not to be
visible during the request::activate callback.

This requires an initial call to `awesome_refresh` before the main loop
to get `awesome.startup` right.

Ref: https://github.com/awesomeWM/awesome/commit/90fde139#commitcomment-9308225
2015-02-10 09:35:53 +01:00
Uli Schlachter 90fde1393f awful.tag: Use delayed_call to call withcurrent on manage
This way this function runs after everything else did its job. The client will
only get assigned a tag after everything else had a chance to do so.

Thanks to this, awful.rules no longer has to disconnect the call to withcurrent.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-11 11:19:04 +01:00
Emmanuel Lepage Vallee 37684abe33 Add context to request::activate signal 2014-10-25 23:31:23 -04:00
Uli Schlachter dcc348d75e Fix some random ldoc warnings
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-13 18:06:49 +02:00
Daniel Hahler df23964b20 Make callbacks to rules.execute optional 2014-04-01 10:48:18 +02:00
Daniel Hahler 8194d555ec Set c.screen in ewmh.tag and before tags in rules.execute
The current premise is that c.screen should be the same as
awful.tag.getscreen(t).

The addition in `ewmh.tag` appears to be the important part here,
changing the order in awful.rules.execute is (maybe) only for
consistency across the codebase.
2014-03-24 17:01:52 +01:00
Uli Schlachter ae996ee8d6 awful.rules: Emit request::activate on the client
There is a strong hint that you are doing something wrong: You call
client.emit_signal(some_signal, c). Chances are high that this signal is
supposed to be emitted on the client object 'c' instead of the underlying client
class.

This applies to awful.rules' usage of this signal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-18 16:01:04 +01:00
Daniel Hahler 9a5a8dc6e8 Factor `awful.rules.apply_do` out of `apply`
This allows to apply properties and callbacks to a client like
awful.rules.apply would do, without the matching part.

This is useful with the new startup notifications, and lets you apply
the same properties and callbacks from e.g. a manage signal handler.
2014-03-16 20:20:14 +01:00
Daniel Hahler d9aed1b21e awful.rules: add does_match and matching_rules functions (FS#1224)
Signed-off-by: Daniel Hahler <git@thequod.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-15 09:00:20 +01:00
Daniel Hahler c855b1babb Do not raise clients in client_manage
Instead, use stack_client_push and emit the `request::activate` signal
from awful.rules.apply, if the client gets focus.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-12 16:01:01 +01:00
Uli Schlachter 96e03cb45d Lots of random documentation fixes
This is mostly about mis-named parameters, but also other small things.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 14:09:10 +01:00
Clément Démoulins d729b71b17 Fix a bug when using in a rule the property 'tag'.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-26 18:22:05 +02:00
Uli Schlachter 48c6c11d17 awful.rules: Implement callbacks for individual properties
When a property is now set to a function, the function's return value will be
used for the value of the property. The function gets the new client as its only
argument.

There is no property which accepts a function as its value and thus this change
can't break anything (yeah, famous last words...).

This should fix half of FS#1011. Panels now don't get focused by awful.rules.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-07-06 17:30:35 +02:00
Arvydas Sidorenko 61ff9ce2b7 Ported awful to lua 5.2
Tested with lua 5.1: all good

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-16 17:37:30 +02:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Julien Danjou 52dfb76819 awful.rules: fix typo in example
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-03-29 09:37:30 +02:00
Anurag Priyam 448583e87c rules: allow defining exceptions to a rule - except, and except_any
So you want to make all Firefox windows floating except the main window
(instance = Navigator). You can either list all possible windows in
rules and make them floating, or make all of them floating except one:

{ rule = { class = "Firefox" },
  except = { instance = "Navigator" },
  properties = {floating = true},
}

More examples in the docs.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-29 09:26:24 +02:00
Ignas Anikevicius (gns_ank) 2c1d09ebc2 Add match_any function and rule_any definition for different client matching.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-14 16:51:40 +02:00
Uli Schlachter f89252962e Fix an invalid index in awful.rules
A rule like { focus = true } would cause debug::index::miss and
debug::newindex::miss to be emitted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:48:00 +02:00
Julien Danjou 6d332f07a0 lua{class,object}: rename signals functions
I knew this was wrong at the beginning, f*ck.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Uli Schlachter 0e869b7b15 Remove invalid variable usage
There is no variable called "startup" in awful.rules.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:38 +02:00
Adrian C. (anrxc) 81b073e0a5 awful.rules: fix client tagging with multiple screens
Commit a757dda replaced the awful.client.movetotag call with c:tags()
in the tag property handler. Which introduced a regression when more
than one screen is used. The awful.tag.withcurrent function was being
called even when there was a valid tag property. Now the clients
screen is set to the tag screen to ensure the client is moved to the
correct tag and screen.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-01-11 10:09:27 +01:00
koniu 5e7ddd1efa awful.rules: tag clients without flicker (FS#664)
We unregister the default awful.tag.withcurrent 'manage' signal handler
and have awful.rules.apply handle initial client tagging.

Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-01-08 19:11:30 +01:00
Hiltjo Posthuma 0a9f7985f8 Rules: change example
change example since the example with a centered client doesnt work
on the default config (due to no_overlap).

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 20:24:45 +01:00
Hiltjo Posthuma 3e3395a6a0 Rules: check if properties of a rule exist
Actually check if properties are set now, since we can also only
apply callbacks now.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 20:24:16 +01:00
bob 4aaf39a899 awful.rules: add "callback" option when a rule matches
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 10:25:40 +01:00
Anton Bobrov ad50440d5c awful.rules: apply accumulated rule properties (FS#669)
To avoid the screen flickering, when two rules have different tags
with true switchtotag.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-26 10:27:44 +01:00
Cedric GESTES 62b0a9d8f1 rules: define geometry properties
Signed-off-by: Cedric GESTES <ctaf42@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-07 18:04:23 +02:00
Cedric GESTES 1df4f1c66c rules: if a client has not the property we search: dont match
Signed-off-by: Cedric GESTES <ctaf42@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 13:32:42 +02:00
Cedric GESTES ddc159f57e rules: add a switchtotag rule to select the tag after setting it for a client
Signed-off-by: Cedric GESTES <ctaf42@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 14:01:07 +02:00
Cedric GESTES cbaefeed9d rules: accept rule if regexp is ok or value is equal
correct problem matching expression with - or special regexp character

Signed-off-by: Cedric GESTES <ctaf42@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 10:58:58 +02:00
Julien Danjou 8ec1f4f49c awful.rules: set focus as last property
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 11:40:35 +02:00
Julien Danjou af5037104c awful.rules: document matching, support non-string rules
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 16:43:00 +02:00
Julien Danjou 6d65106c36 awful.rules: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 16:27:28 +02:00