Crates.io | kzones-config |
lib.rs | kzones-config |
version | 0.1.1 |
source | src |
created_at | 2024-10-11 21:41:35.838337 |
updated_at | 2024-10-11 22:18:17.181422 |
description | Make definitions of kzones layouts easier |
homepage | |
repository | https://github.com/miro662/kzones-config |
max_upload_size | |
id | 1405874 |
size | 48,856 |
KZones is a KWin script for snapping windows into zones. However, its configuration is a bit cumbersone. This CLI tool provides a much shorter way of defining layouts.
cargo
cargo install kzones-config
kzones-config --input <CONFIG_FILE>
prints a JSON config on a standard output. That should be pasted into KZones' settings, in a Layouts
tab. Remember to restart KZones after changing its configuration
Input file is a TOML file that looks like this
padding = 10
[layouts]
layout_name = "horizontal(1,1)"
padding
field defines padding that will be set for all layouts. layouts
is a mapping between names of layouts and its descriptions, in layout definition format.
See examples/config.toml
for an example input file.
A split is defined as <direction>(<1st_node>, <2nd_node>, ...)
, where direction
can be either horizontal
or vertical
. Each node is described by a number. Numbers describes a ratio between sizes of zones.
For example, horizontal(1, 2, 1)
will create three arenas:
horizontal
/vertical
can be abbreviated as h
/v
.
We can further split nodes by adding a :
after number and specifying another split.
For example, horizontal(1, 2: vertical(2, 3), 1)
will create four areas:
There is no limit on level of layout nesting.
horizontal(1, 1)
horizontal(2, 3, 2)
horizontal(2, 1: vertical(1, 1))
vertical(2, 3: horizontal(2, 3))
application
setting of a layout (in TOML, not as an extension of layout definition format),