2014-03-08 22:32:32 +00:00
|
|
|
## Configuring rules
|
|
|
|
|
|
|
|
### General description
|
|
|
|
|
|
|
|
Not all windows should be managed by bug.n the same way, or even may not be
|
2018-01-14 21:53:01 +00:00
|
|
|
manageable at all. To handle windows differently, you can add rules to the
|
2014-03-08 22:32:32 +00:00
|
|
|
configuration.
|
|
|
|
|
2015-03-09 02:35:38 +00:00
|
|
|
The general format of a rule added to `Config.ini` is as follows (all in one
|
|
|
|
line, ";" is not allowed as a character in the field values):
|
|
|
|
|
|
|
|
```
|
|
|
|
Config_rule=<class>;
|
|
|
|
<title>;
|
|
|
|
<function name>;
|
|
|
|
<is managed>;
|
|
|
|
<monitor>;
|
2015-03-09 19:42:31 +00:00
|
|
|
<views / tags>;
|
2015-03-09 02:35:38 +00:00
|
|
|
<is floating>;
|
|
|
|
<is decorated>;
|
|
|
|
<hide title>;
|
|
|
|
<action on a single window>
|
|
|
|
```
|
|
|
|
|
2014-03-08 22:32:32 +00:00
|
|
|
With the first part of the rule, you identify the window using the
|
|
|
|
following information:
|
|
|
|
|
|
|
|
1. class (as a regular expression)
|
|
|
|
2. title (as a regular expression)
|
2018-01-14 21:53:01 +00:00
|
|
|
3. arbitrary criterion (as a function name, e.g. "Window_isPopup", or blank)
|
2014-03-08 22:32:32 +00:00
|
|
|
|
|
|
|
With the second part you can give bug.n the following information on how to
|
|
|
|
handle the identified windows:
|
|
|
|
|
|
|
|
1. Is the window managed at all (0 = no, 1 = yes)?
|
|
|
|
2. On which monitor should the window be moved (given as an integer >= 0,
|
|
|
|
0 means the currently active monitor)?
|
|
|
|
3. On which views should the window be set (given as a binary mask converted to
|
|
|
|
an integer >= 0, 0 means the currently active view)?
|
2018-01-14 21:53:01 +00:00
|
|
|
4. Is the window floating, i.e. should not be tiled (0 = no, 1 = yes)?
|
2014-03-08 22:32:32 +00:00
|
|
|
5. Is the window decorated (0 = no, 1 = yes)? If not, the window title bar is
|
|
|
|
removed.
|
|
|
|
6. Should the title text be hidden in the bug.n bar (0 = no, 1 = yes)?
|
2015-01-25 18:16:30 +00:00
|
|
|
7. A special single window action (`close` or `maximize` or blank).
|
2014-03-08 22:32:32 +00:00
|
|
|
|
|
|
|
If you want to replace a rule, which is already set in `Config.ahk`, you will
|
2018-01-14 21:53:01 +00:00
|
|
|
have to use the correct variable name; e.g. you may set a default rule
|
2014-03-08 22:32:32 +00:00
|
|
|
(identifying part: `.*;.*;`), overwriting the first rule set in `Config.ahk`,
|
|
|
|
by using the variable name `Config_rule_#1`. If you want to _add_ a rule,
|
|
|
|
simply use `Config_rule` as the variable name; the numbering will be done
|
|
|
|
automatically by bug.n when reading `Config.ini` using the order given there.
|
|
|
|
|
2015-03-09 19:42:31 +00:00
|
|
|
To get a draft for a new rule, you can use the hotkey
|
|
|
|
`#i::Manager_getWindowInfo()` (<kbd>Win</kbd><kbd>I</kbd>), which will give the
|
|
|
|
full class and title, additional information about and the current values for
|
|
|
|
the active window included in a string, which can be copied to the
|
|
|
|
`Config.ini`.
|
|
|
|
|
2014-03-08 22:32:32 +00:00
|
|
|
#### Views / Tags
|
|
|
|
|
|
|
|
You can set a window to more than one view. Add up the associated numbers as
|
|
|
|
shown in the following table and set the sixth field of the rule to the value
|
|
|
|
of the sum.
|
|
|
|
|
|
|
|
| view / tag | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | n | all |
|
|
|
|
| ---------------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -------------- | --- |
|
|
|
|
| number to sum up | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | `2 ** (n - 1)` | 511 |
|
|
|
|
|
|
|
|
An example would be the value `17` for views 1 and 5.
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
|
|
|
#### Mozilla Firefox
|
|
|
|
|
2015-02-27 20:57:32 +00:00
|
|
|
The following `Config.ini` line replaces rule number 16 in the default
|
2014-03-08 22:32:32 +00:00
|
|
|
configuration, putting windows of 'Mozilla Firefox' on view 5, keeping the
|
|
|
|
title bar visible and maximizing them.
|
|
|
|
|
2015-02-27 20:57:32 +00:00
|
|
|
`Config_rule_#16=MozillaWindowClass;.*Mozilla Firefox;;1;0;16;0;1;0;maximize`
|
2014-03-08 22:32:32 +00:00
|
|
|
|
|
|
|
#### Mozilla Thunderbird
|
|
|
|
|
|
|
|
The following `Config.ini` line adds a rule, putting windows of 'Mozilla
|
|
|
|
Thunderbird' on view 4, keeping the title bar visible and maximizing them.
|
|
|
|
|
2015-01-25 18:16:30 +00:00
|
|
|
`Config_rule=MozillaWindowClass;.*Mozilla Thunderbird;;1;0;8;0;1;0;maximize`
|
2015-03-08 20:57:11 +00:00
|
|
|
|
|
|
|
#### GNU Emacs
|
|
|
|
|
|
|
|
The following rule avoids the gaps, which would be the result of Emacs'
|
|
|
|
line-oriented resizing of its own windows (frames).
|
|
|
|
|
|
|
|
`Config_rule=Emacs;.*;;1;0;0;0;0;0;maximize`
|
2015-03-09 01:46:13 +00:00
|
|
|
|
|
|
|
#### Atlassian SourceTree
|
|
|
|
|
2015-03-09 19:42:31 +00:00
|
|
|
The following rule excludes the confirmation dialog for removing files from the
|
|
|
|
working copy from being managed by bug.n.
|
2015-03-09 01:46:13 +00:00
|
|
|
|
2015-03-09 19:42:31 +00:00
|
|
|
`Config_rule=.*SourceTree.*;Confirm Remove Modified or Untracked Files?;;0;0;0;1;1;0;`
|
2017-12-26 21:36:22 +00:00
|
|
|
|
|
|
|
#### hunt-n-peck
|
|
|
|
|
|
|
|
As provided by [NickSeagull](https://github.com/NickSeagull) in
|
|
|
|
[issue #146](https://github.com/fuhsjr00/bug.n/issues/146):
|
|
|
|
|
|
|
|
`Config_rule=*hap*;.*hap*;*hap*;0;0;1;1;1;1;`
|