![]() |
![]()
| ![]() |
![]()
NAMEshikane - configuration file DESCRIPTIONshikane uses the TOML file format for its configuration file and contains an array of profiles. Each profile is a table containing an array of output tables. The words “output”, “display” and “monitor” can be used interchangeably. In the text below, however, a distinction is made between “display” and “output”. A “display” refers to a currently connected monitor and an “output” refers to a table in the config file. The same goes for “mode” and “mode” respectively. (Please note the font weight.) shikane selects possible profiles automatically at startup and when a change in the set of currently connected displays occurs. A profile is taken into consideration if every currently connected display can be matched to at least one output and no output is unmatched. A display matches an output if:
After assembling a list of possible profiles shikane generates all variants of every profile. Once all variants have been verified and sorted by exactness, shikane tries to apply them one after the other until one succeeds or there are no variants left to try. Variants are slightly different versions of the same profile. For example, a given display has a set of supported modes: 1920x1080@60Hz and 1920x1080@50Hz. If the mode in the config.toml is specified as “1920x1080” both modes would fit the specification. Instead of choosing just one mode and using that, shikane takes both into account by generating two variants based on the same profile. One variant uses the 1920x1080@60Hz mode and the other variant uses the 1920x1080@50Hz mode. The same goes for the search parameter. If multiple (display,output,mode)-combinations are possible, shikane generates variants with all of them. You don’t need to write the configuration file by hand. You can use any tool to arrange the displays however you want and then use the export command of shikanectl(1). It will generate the config for you. FORMAT
PROFILE FIELDS
On sway(1) for example, display names and descriptions can be obtained via swaymsg -t get_outputs.
OUTPUT FIELDSA display has, among others, the attributes name, vendor, model, serialnumber and description and may look like this: “DP-1”, “Company Foo”, “FooHD-24”, “12345678”, “Something Foo Something Bar” search = "pattern" search = "[kind]pattern" search = "[[attrs]kind]pattern"
The attribute list attrs defines which attributes will be compared with the pattern and how they are weighted. It is a sequence of letters from the set {dnmvs}. The letters correspond to the first letters of the above listed attributes. Each attribute should not be used more than once per search field. The first attribute has the highest/best weight, the last attribute has the lowest/worst weight. For a single search to be considered applicable, all attributes must match the pattern. The search kind kind can be one of {=/%}. The 3 search kinds — regex(/), substring(%), full text(=) — define how the pattern is compared with each attribute in the attrs list. With full text comparison, the given attributes are compared with the pattern for equality. With substring comparison, the given attributes have to contain the pattern as a substring. The weight is calculated by dividing the lengths of the pattern and attribute strings. Equal lengths will rank the same as full text comparison. With regex comparison, the pattern is interpreted as a regular expression. regex comparison will always rank lower than the other two search kinds. The attribute list and the search kind are optional. If unspecified search kind defaults to full text comparison and shikane tries to find at least one matching attribute. Alternatively, several searches, up to a maximum of 5, may be specified in an array.
The mode, position, scale, transform and adaptive_sync options will only change the respective properties of the display if they are specified (e.g. the scaling of a display will not be changed if the scale field is not present). mode = "best" | "preferred" mode = "[!]widthxheight[@rate[Hz]]"
A parameterized mode can optionally be declared as custom by prefixing an exclamation mark (!). In this case, shikane will not try to find a mode with the same parameters and will just send the provided values to the compositor. Setting mode to best or preferred instructs shikane to choose the mode itself. The best mode is determined by shikane as the mode with the highest pixel count, width, height and refresh rate. Most displays announce a mode that they prefer. If mode is set to preferred, shikane will select the preferred mode if it exists. Otherwise, the best mode is chosen as a fallback.
EXAMPLESThe indentations are not necessary and are used here only to illustrate the hierarchy.
A laptop has a builtin display that is always connected.
shikane allows you to specifiy multiple searches. This way profiles can be as specific as possible.
On sway(1) for example, exec can be used to move workspaces to the desired display:
shikane provides the $SHIKANE_PROFILE_NAME variable in the environment of the executed processes of the profile.exec array and the $SHIKANE_OUTPUT_NAME variable in the environment of the output.exec processes. If you are using sway(1), the last variable is especially useful in conjunction with swayws.
AUTHORSHendrik Wolff hendrik.wolff@agdsn.me SEE ALSO
|