added kitty state
This commit is contained in:
parent
95a3b0e55d
commit
3df97e5f4e
24
states/kitty/config.sls
Normal file
24
states/kitty/config.sls
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
{%- from "kitty/map.jinja" import users with context %}
|
||||||
|
{%- for name, user in users.items() %}
|
||||||
|
{%- if user.enabled %}
|
||||||
|
kitty-config-dir-{{ name }}:
|
||||||
|
file.directory:
|
||||||
|
- name: {{ user.home }}/.config/kitty
|
||||||
|
- user: {{ name }}
|
||||||
|
- group: {{ user.gid }}
|
||||||
|
- mode: 0755
|
||||||
|
|
||||||
|
kittyrc-user-{{ name }}:
|
||||||
|
file.managed:
|
||||||
|
- name: {{ user.home }}/.config/kitty/kitty.conf
|
||||||
|
- source: salt://kitty/kitty.conf.j2
|
||||||
|
- user: {{ name }}
|
||||||
|
- group: {{ user.gid }}
|
||||||
|
- mode: 0644
|
||||||
|
- template: jinja
|
||||||
|
- require:
|
||||||
|
- pkg: kitty-pkg
|
||||||
|
- file: kitty-config-dir-{{ name }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
7
states/kitty/defaults.yaml
Normal file
7
states/kitty/defaults.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
kitty:
|
||||||
|
config:
|
||||||
|
term: "xterm-256color"
|
||||||
|
foreground: "#55ee55"
|
||||||
|
detect_urls: "no"
|
||||||
|
mouse_map: "left click ungrabbed no_op"
|
5
states/kitty/init.sls
Normal file
5
states/kitty/init.sls
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
include:
|
||||||
|
- users
|
||||||
|
- .install
|
||||||
|
- .config
|
5
states/kitty/install.sls
Normal file
5
states/kitty/install.sls
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
{%- from "kitty/map.jinja" import kitty with context %}
|
||||||
|
kitty-pkg:
|
||||||
|
pkg.latest:
|
||||||
|
- name: kitty
|
4
states/kitty/kitty.conf.j2
Normal file
4
states/kitty/kitty.conf.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{%- from "kitty/map.jinja" import kitty with context %}
|
||||||
|
{%- for key, value in kitty.config.items() %}
|
||||||
|
{{ key }} {{ value }}
|
||||||
|
{%- endfor %}
|
4
states/kitty/map.jinja
Normal file
4
states/kitty/map.jinja
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{%- import_yaml "kitty/defaults.yaml" as defaults -%}
|
||||||
|
|
||||||
|
{%- set kitty = salt['pillar.get']('kitty', default=defaults.kitty, merge=True) -%}
|
||||||
|
{%- set users = salt['pillar.get']('users') -%}
|
Loading…
Reference in New Issue
Block a user