Skip to content

Commit

Permalink
docs: add configuration.md
Browse files Browse the repository at this point in the history
  • Loading branch information
coffebar committed Jan 9, 2024
1 parent 7cc09c8 commit e9be52e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Add this line to your hyprland.conf
exec-once = /usr/bin/hyprland-per-window-layout
```

## Configuration

Optional, please read [configuration.md](configuration.md) for more details.

-----


Expand Down
63 changes: 63 additions & 0 deletions configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Configuration

## Reason to have configuration

This program can be used without a configuration file. But you may want to have a configuration file to:

- Set up a keyboard layout for a specific window classes

## Configuration file

Create a file
~/.config/hyprland-per-window-layout/options.toml

Example configuration file:

```toml
# list of keyboards to operate on
# use `hyprctl devices -j` to list all keyboards
keyboards = [
"lenovo-keyboard",
]

# layout_index => window classes list
# use `hyprctl clients` to get class names
[[default_layouts]]
1 = [
"org.telegram.desktop",
]
```

This example will set your second layout for the Telegram by default.

1 - is a layout index. In case of this input configuration:
```
input {
kb_layout = us,es,de
...
```
*us* index is 0, *es* index is 1, *de* index is 2.

Note, *keyboards* section is required for default_layouts feature.

Here is more complex example if you have 3 layouts and 2 keyboards:

```toml
# list of keyboards to operate on
# use `hyprctl devices -j` to list all keyboards
keyboards = [
"apple-magic-keyboard",
"lenovo-keyboard",
]

# layout_index => window classes list
# use `hyprctl clients` to get class names
[[default_layouts]]
1 = [
"org.telegram.desktop",
"discord",
]
2 = [
"firefox",
]
```

0 comments on commit e9be52e

Please sign in to comment.