79 lines
2.7 KiB
Markdown
79 lines
2.7 KiB
Markdown
Kanshi Ansible role
|
|
-------------------
|
|
|
|
This role install and configure [Kanshi](https://git.sr.ht/~emersion/kanshi})
|
|
service.
|
|
|
|
|
|
## Variables
|
|
|
|
This role needs two variables for creating Kanshi configuration file
|
|
`sway_output` provided by [ansible-sway](https://git.epha.se/ephase/ansible-sway)
|
|
role and `kanshi_profiles`.
|
|
|
|
`sway_outputs` is not mandatory butuseful to provide id ans options for outputs.
|
|
|
|
Here is an example of `kanshi_profile`
|
|
|
|
```yaml
|
|
kanshi_profiles:
|
|
- profile: 'laptop'
|
|
screens:
|
|
- id: 'eDP-1'
|
|
- profile: 'home'
|
|
screens:
|
|
- id: 'eDP-1'
|
|
enable: false
|
|
- id: 'iiyama_27_4k'
|
|
position: '1080,0'
|
|
- id: 'iiyama_23_fhd'
|
|
position: '0,0'
|
|
mode: '1920x1024'
|
|
transform: 90
|
|
options:
|
|
- id: 'eDP-1'
|
|
option: 'bg'
|
|
value: '~/images/bg.jpg'
|
|
commands:
|
|
- swaymsg workspace 1, move workspace to +eDP1+
|
|
```
|
|
|
|
* `profile`: name of the profile
|
|
* `screens`: list of outputs
|
|
* `id`: id of the screen, could be the real name, ouput name like *HDMI-1*
|
|
(both given by `swaymsg -t output`) or id referenced in `sway_outputs`
|
|
* `position`: absolute position of the screen
|
|
* `mode`: resolution of the screen
|
|
* `scale`: scale factor for the screen
|
|
* `transform`: rotation (90, 180 or 270 degres) for the screen
|
|
* `options`: list of options:
|
|
* `id`: see above in *screens* section
|
|
* `options`: option name
|
|
* `value`: value
|
|
* `commands`: list of command to execute when switching to profile
|
|
|
|
## Licence
|
|
|
|
This script is released under le [MIT licence][l_mit]
|
|
|
|
Copyright © 2021 Yorick Barbanneau
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
this software and associated documentation files (the "Software"), to deal in
|
|
the Software without restriction, including without limitation the rights to
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice (including the next
|
|
paragraph) shall be included in all copies or substantial portions of the
|
|
Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
[l_mit]:https://opensource.org/licenses/mit-license.php
|