Order sway configuration file
This commit is contained in:
parent
b745ea72f1
commit
50c485a8cf
6 changed files with 69 additions and 5 deletions
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
- name: Create Sway config dirs
|
- name: Create Sway config dirs
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: '{{ ansible_user_dir ~ "/.config/sway/test.d" }}'
|
path: '{{ ansible_user_dir ~ "/.config/sway/conf.d" }}'
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0750
|
mode: 0750
|
||||||
owner: '{{ ansible_user_uid }}'
|
owner: '{{ ansible_user_uid }}'
|
||||||
|
@ -38,8 +38,9 @@
|
||||||
validate: >-
|
validate: >-
|
||||||
sh -c "if sway --config %s --validate 2>&1 | grep -q sway/config.c; then >&2 echo \"Error validating sway configuration\"; exit 1; else exit 0; fi"
|
sh -c "if sway --config %s --validate 2>&1 | grep -q sway/config.c; then >&2 echo \"Error validating sway configuration\"; exit 1; else exit 0; fi"
|
||||||
loop:
|
loop:
|
||||||
- keybindings
|
- 10-input
|
||||||
- theme
|
- 20-output
|
||||||
- output
|
- 30-theme
|
||||||
- input
|
- 40-workspaces
|
||||||
|
- 50-keybindings
|
||||||
any_errors_fatal: true
|
any_errors_fatal: true
|
||||||
|
|
9
templates/10-input.config.j2
Normal file
9
templates/10-input.config.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{% if sway_inputs is defined %}
|
||||||
|
{% for input in sway_inputs %}
|
||||||
|
input {{ input.name }} {
|
||||||
|
{% for option in input.options %}
|
||||||
|
{{ option.option }} {{ option.value }}
|
||||||
|
{% endfor %}
|
||||||
|
}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
9
templates/20-output.config.j2
Normal file
9
templates/20-output.config.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{% if sway_outputs %}
|
||||||
|
{% for output in sway_outputs %}
|
||||||
|
output {{ output.name ~ " " }}
|
||||||
|
{%- for option in output.options %}
|
||||||
|
{{ option.option }} {{ option.value }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
11
templates/30-theme.config.j2
Normal file
11
templates/30-theme.config.j2
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{% for k,v in sway_theme_parameters.items() %}
|
||||||
|
{{ k }} {{ v }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for client, c in sway_theme_colors.items() %}
|
||||||
|
client.{{ client }} {{ c.border }} {{ c.backgound}} {{ c.text }}
|
||||||
|
{%- if c.indicator is defined %} {{ c.indicator }}
|
||||||
|
{%- if c.child_border is defined %} {{ c.child_border }}{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endfor %}
|
9
templates/40-workspaces.config.j2
Normal file
9
templates/40-workspaces.config.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{% for k,v in sway_workspaces.items() %}
|
||||||
|
set $ws{{ k }} {{ v }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if sway_rules is defined %}
|
||||||
|
{% for i in rules %}
|
||||||
|
{{ i.verb }} {{ i.query }} {% if i.verb == 'assign' %}$ws{% endif %}{{ i.action }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
25
templates/50-keybindings.config.j2
Normal file
25
templates/50-keybindings.config.j2
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
set $mod Mod4
|
||||||
|
set $left h
|
||||||
|
set $down j
|
||||||
|
set $up k
|
||||||
|
set $right l
|
||||||
|
|
||||||
|
# Dynamic workspace keybindings
|
||||||
|
{% for k,v in sway_workspaces.items() %}
|
||||||
|
bindsym $mod+{{ k }} workspace $ws{{ k }}
|
||||||
|
bindsym $mod+Shift+{{ k }} move container to workspace $ws{{ k }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for section in sway_keybindings %}
|
||||||
|
{% if section.mode != "normal" %}
|
||||||
|
mode {{ section.mode }} {
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for bind in section.bindings %}
|
||||||
|
bindsym {{ bind.bindsym }} {{ bind.action}}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if section.mode != "normal" %}
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
Loading…
Add table
Add a link
Reference in a new issue