setcfact - bakkeby/dusk GitHub Wiki

Function Expected argument Default keybindings
setcfact float, e.g. 0.25 or -0.25 Super+Shift+h, Super+Shift+l

The setcfact function increases or decreases the the size of the client respective to other client windows in the same area.

setcfact.gif

More precisely it changes the cfact (client factor) variable for the selected client.

The value of the client factor may seem somewhat arbitrary, but one may think of it as the weight of a client compared to other clients in the same area.

In the screenshot above there are four clients in the stack area.

The default cfact value for a client is 1.0 and the size allocated is derived by the factor of each individual client divided by the sum of the client factors.

As all clients initially have the same value the space is divided evenly and each client takes up 25% of the window area.

1.0 / (1.0 + 1.0 + 1.0 + 1.0) = 0.25

Then the cfact for the second client in the area is increased with 0.25 twice which means that it will take up a third of the window area while the remaining three clients take up 22% each.

1.0 / (1.0 + 1.5 + 1.0 + 1.0) = 0.22
1.5 / (1.0 + 1.5 + 1.0 + 1.0) = 0.33

The minimum value of cfact is 0.25 and the maximum value is 4.0. One may think of this as a quarter of the initial weight and four times the initial weight.

The argument passed to the function indicates how much to increase or decrease the client factor with and by default these are 0.25 and -0.25 respectively.

The cfact can also be set absolutely with argument values greater than 4.0 (in which case 4.0 is subtracted from the value used). E.g. passing 8.0 will set the factor as 4.0 which is the maximum weight the client can have.

The cfact can also be reverted back to default (1.0) by passing the value of 0.

Note that not all layouts take cfact into account.

The default keybindings are to use Super+Shift+h to increase cfact for the selected client and Super+Shift+l to decrease it.

External commands:

duskc run_command setcfact 0.25   # increases the client factor by a quarter weight
duskc run_command setcfact -0.25  # decrease the client factor by a quarter weight
duskc run_command setcfact 0      # reset client factor back to default weight (1.0)
duskc run_command setcfact 8.0    # explicitly set cfact to 4.0 (maximum weight)
duskc run_command setcfact 4.25   # explicitly set cfact to 0.25 (minimum weight)

Also see the setmfact function.

Back to Functions > Tiled.

⚠️ **GitHub.com Fallback** ⚠️