Add variables templates

This commit is contained in:
Yorick Barbanneau 2022-11-18 23:18:33 +01:00
parent 50c485a8cf
commit 4cc219cec0
4 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,14 @@
---
sway_variables:
- name: '$left'
value: 'h'
- name: '$down'
value: 'j'
- name: '$up'
value: 'k'
- name: '$right'
value: 'l'
- name: '$term'
value: 'foot'
- name: '$menu'
value: 'dmenu_path | dmenu | xargs swaymsg exec --'

1
files/90-startup.config Normal file
View file

@ -0,0 +1 @@
exec_always "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -38,9 +38,16 @@
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"
loop:
- 00-variables
- 10-input
- 20-output
- 30-theme
- 40-workspaces
- 50-keybindings
any_errors_fatal: true
- name: Copy default startup Sway conf file
ansible.builtin.copy:
src: '90-startup.config'
dest: '{{ ansible_user_dir }}/.config/systemd/user/'
mode: 0640

View file

@ -0,0 +1,5 @@
{% if sway_variables %}
{% for v in sway_variables %}
set {{ v.name }} {{ v.value}}
{% endfor %}
{% endif %}