Adapt keybinding to new sway config checker

This commit is contained in:
Yorick Barbanneau 2022-11-30 09:57:24 +01:00
parent f283ca1b48
commit 85b752815d
4 changed files with 11 additions and 38 deletions

View file

@ -64,25 +64,7 @@ sway_inputs:
### Keybinding ### Keybinding
Keybinding require two variables: `sway_keys_variables` and `sway_keybindings`. Keybinding require one variables: `sway_keys_variables`.
`sway_keys_variables` defined variables for keybinding. Because configuration
file checking throw an error if the first argument of `bindsym` contains a
variable not defined is the file (because `10-variables.config` is not included
when testing)
```yaml
sway_keys_variables:
- name: '$left'
value: 'h'
- name: '$down'
value: 'j'
- name: '$up'
value: 'k'
- name: '$right'
value: 'l'
- name: '$mod'
value: 'Mod4'
```
```yaml ```yaml
sway_keybindings: sway_keybindings:

View file

@ -1,16 +1,4 @@
--- ---
sway_keys_variables:
- name: '$left'
value: 'h'
- name: '$down'
value: 'j'
- name: '$up'
value: 'k'
- name: '$right'
value: 'l'
- name: '$mod'
value: 'Mod4'
sway_keybindings: sway_keybindings:
- mode: 'normal' - mode: 'normal'
bindings: bindings:

View file

@ -4,3 +4,13 @@ sway_variables:
value: 'foot' value: 'foot'
- name: '$menu' - name: '$menu'
value: 'dmenu_path | dmenu | xargs swaymsg exec --' value: 'dmenu_path | dmenu | xargs swaymsg exec --'
- name: '$left'
value: 'h'
- name: '$down'
value: 'j'
- name: '$up'
value: 'k'
- name: '$right'
value: 'l'
- name: '$mod'
value: 'Mod4'

View file

@ -1,10 +1,3 @@
# Keys variables
{% if sway_keys_variables %}
{% for v in sway_keys_variables %}
set {{ v.name }} {{ v.value}}
{% endfor %}
{% endif %}
# Dynamic workspace keybindings # Dynamic workspace keybindings
{% for k,v in sway_workspaces.items() %} {% for k,v in sway_workspaces.items() %}
bindsym $mod+{{ k }} workspace $ws{{ k }} bindsym $mod+{{ k }} workspace $ws{{ k }}