diff --git a/hosts/default.toml b/hosts/default.toml index e5ec4e8..958166a 100644 --- a/hosts/default.toml +++ b/hosts/default.toml @@ -8,3 +8,5 @@ system-mono-font = "Fira Mono" [[outputs]] match = "*" background = ["~/.local/share/backgrounds/sway-dark-1920x1080.png", "fill"] + +inputs = [] diff --git a/hosts/liberation.toml b/hosts/liberation.toml new file mode 100644 index 0000000..0d289ad --- /dev/null +++ b/hosts/liberation.toml @@ -0,0 +1,12 @@ +wireless = ["wlp170s0"] +#ethernet = ["enp2s0"] +temperature-path = "/sys/class/hwmon/hwmon4/temp1_input" + +[[outputs]] +match = "eDP-1" +scale = 1.5 +background = ["~/.local/share/backgrounds/sway-dark-1920x1080.png", "fill"] + +[[inputs]] +match = "2362:628:PIXA3854:00_093A:0274_Touchpad" +tap = "enabled" diff --git a/install.py b/install.py index 8f9f431..a4d27eb 100755 --- a/install.py +++ b/install.py @@ -93,6 +93,20 @@ def main(): host_config['name'] = args.hostname # Preprocess output configs for sway + for input in host_config['inputs']: + # Generate config lines for sway template + lines = [] + for key in input: + if key == 'match': + continue + if isinstance(input[key], list): + val = ' '.join(repr(elem) for elem in input[key]) + else: + val = repr(input[key]) + lines.append(f'{key} {val}') + + input['sway-lines'] = lines + for output in host_config['outputs']: # Generate config lines for sway template lines = [] diff --git a/templates/.config/sway/config b/templates/.config/sway/config index 49ce198..8c2a1b5 100644 --- a/templates/.config/sway/config +++ b/templates/.config/sway/config @@ -45,6 +45,14 @@ output ${repr(output['match'])} { } % endfor +% for input in host.get('inputs', []): +input ${repr(input['match'])} { +% for line in input['sway-lines']: + ${line} +% endfor +} +%endfor + gaps inner 8 input type:Mouse accel_profile flat