Add documentation and example for window rules
This commit is contained in:
parent
76f292332b
commit
5ca0b9d157
3 changed files with 67 additions and 2 deletions
|
|
@ -71,6 +71,57 @@ borders {
|
||||||
|
|
||||||
Colors are specified in `0xRRGGBB` or `0xRRGGBBAA` hex format.
|
Colors are specified in `0xRRGGBB` or `0xRRGGBBAA` hex format.
|
||||||
|
|
||||||
|
## Window Rules
|
||||||
|
|
||||||
|
Window rules let you set certain properties on windows when they first appear,
|
||||||
|
based on their `app_id` and/or `title`. Crucially, you can override them any time after
|
||||||
|
that, it's only when the window is first created. Rules are placed inside a `window_rules` block:
|
||||||
|
|
||||||
|
```kdl
|
||||||
|
window_rules {
|
||||||
|
// Float Firefox picture-in-picture windows
|
||||||
|
float app_id="firefox" title="Picture-in-Picture"
|
||||||
|
// Float any window with "Preferences" in the title
|
||||||
|
float title="*Preferences*"
|
||||||
|
// Keep mpv windows tiled
|
||||||
|
no_float app_id="mpv"
|
||||||
|
// Send Slack to tag 3 (1<<2 = 0x0004)
|
||||||
|
tags 0x0004 app_id="Slack"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Rule Types
|
||||||
|
|
||||||
|
| Rule | Argument | Description |
|
||||||
|
|------------|------------------|------------------------------------------|
|
||||||
|
| `float` | | Make matching windows float |
|
||||||
|
| `no_float` | | Keep matching windows tiled |
|
||||||
|
| `tags` | u32 (bitmask) | Assign matching windows to specific tags |
|
||||||
|
|
||||||
|
### Matching
|
||||||
|
|
||||||
|
Each rule can have an `app_id=` and/or `title=` property. Both support glob patterns:
|
||||||
|
|
||||||
|
| Pattern | Matches |
|
||||||
|
|---------------|--------------------------------|
|
||||||
|
| `"foo"` | Exact match only |
|
||||||
|
| `"foo*"` | Starts with "foo" |
|
||||||
|
| `"*foo"` | Ends with "foo" |
|
||||||
|
| `"*foo*"` | Contains "foo" |
|
||||||
|
| `"*"` | Everything |
|
||||||
|
|
||||||
|
A rule with no `app_id=` or `title=` property matches all windows. If both are
|
||||||
|
specified, both must match.
|
||||||
|
|
||||||
|
### Evaluation
|
||||||
|
|
||||||
|
Rules are evaluated top-to-bottom. Each matching rule applies only the properties it
|
||||||
|
specifies, so multiple rules can contribute different properties to the same window.
|
||||||
|
For the same property, later rules override earlier ones.
|
||||||
|
|
||||||
|
Rules are applied once during window initialization. Title changes after initialization
|
||||||
|
do not re-trigger rules.
|
||||||
|
|
||||||
## Bar
|
## Bar
|
||||||
|
|
||||||
The bar is an optional widget that shows the time on your screen. Right now, that's it.
|
The bar is an optional widget that shows the time on your screen. Right now, that's it.
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
These are in rough order of my priority, though no promises I do them in this order.
|
These are in rough order of my priority, though no promises I do them in this order.
|
||||||
|
|
||||||
|
- [ ] Move orphan handling out of .output and .seat events; into manage()
|
||||||
|
- [ ] Add focused window title to bar
|
||||||
- [ ] Support overriding config location
|
- [ ] Support overriding config location
|
||||||
- [ ] Support configuring primary vs secondary stack side
|
- [ ] Support configuring primary vs secondary stack side
|
||||||
- [ ] Support switch handling (e.g. lid close)
|
- [ ] Support switch handling (e.g. lid close)
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@ borders {
|
||||||
color_focused "0x89b4fa"
|
color_focused "0x89b4fa"
|
||||||
color_unfocused "0x1e1e2e"
|
color_unfocused "0x1e1e2e"
|
||||||
}
|
}
|
||||||
// Bar widget - shows the time
|
// Bar widget; shows the time
|
||||||
bar {
|
bar {
|
||||||
position top
|
position top
|
||||||
}
|
}
|
||||||
// Tag overlay widget - shown briefly when switching tags
|
// Tag overlay widget; shown briefly when switching tags
|
||||||
// Remove this block to disable the overlay entirely
|
// Remove this block to disable the overlay entirely
|
||||||
tag_overlay {
|
tag_overlay {
|
||||||
tag_amount 10
|
tag_amount 10
|
||||||
|
|
@ -35,6 +35,18 @@ tag_overlay {
|
||||||
square_inactive_border_color "0x6c7086"
|
square_inactive_border_color "0x6c7086"
|
||||||
square_inactive_occupied_color "0xcdd6f4"
|
square_inactive_occupied_color "0xcdd6f4"
|
||||||
}
|
}
|
||||||
|
// Window rules; applied once when a window first appears
|
||||||
|
// Rules are evaluated top-to-bottom; later rules override earlier ones
|
||||||
|
window_rules {
|
||||||
|
// Float Firefox picture-in-picture windows
|
||||||
|
float app_id="firefox" title="Picture-in-Picture"
|
||||||
|
// Float any window with "Preferences" in the title
|
||||||
|
float title="*Preferences*"
|
||||||
|
// Keep mpv windows tiled
|
||||||
|
no_float app_id="mpv"
|
||||||
|
// Send Slack to tag 3 (1<<2 = 0x0004)
|
||||||
|
tags 0x0004 app_id="Slack"
|
||||||
|
}
|
||||||
keybinds {
|
keybinds {
|
||||||
// Swap a window
|
// Swap a window
|
||||||
spawn Mod4 T foot
|
spawn Mod4 T foot
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue