diff --git a/roles/windows-terminal/tasks/actions.yaml b/roles/windows-terminal/tasks/actions.yaml new file mode 100644 index 0000000..b41a6a7 --- /dev/null +++ b/roles/windows-terminal/tasks/actions.yaml @@ -0,0 +1,31 @@ +--- +- name: get list of existing actions + set_fact: + actions: '{{settings.actions}}' + action_keys: '{{settings.actions | json_query("[].keys")}}' + +- name: add next tab action key mapping + when: '"alt+shift+]" not in action_keys' + set_fact: + actions: >- + {{ + actions + [{ + "command": {"action": "nextTab", "tabSwitcherMode": "disabled"}, + "keys": "alt+shift+]" + }] + }} + +- name: add previous tab action key mapping + when: '"alt+shift+[" not in action_keys' + set_fact: + actions: >- + {{ + actions + [{ + "command": {"action": "prevTab", "tabSwitcherMode": "disabled"}, + "keys": "alt+shift+[" + }] + }} + +- name: set actions in settings + set_fact: + settings: '{{settings | combine({"actions": actions})}}' diff --git a/roles/windows-terminal/tasks/main.yaml b/roles/windows-terminal/tasks/main.yaml new file mode 100644 index 0000000..2482c62 --- /dev/null +++ b/roles/windows-terminal/tasks/main.yaml @@ -0,0 +1,17 @@ +--- +- name: read settings.json file + slurp: + src: '{{windows_terminal_settings_json}}' + register: slurped_settings + +- name: decode settings into fact + set_fact: + settings: '{{slurped_settings.content | b64decode | from_json}}' + +- import_tasks: actions.yaml +# TODO: - import_tasks: profiles.yaml + +- name: write settings.json file + copy: + content: '{{settings | to_nice_json}}' + dest: '{{windows_terminal_settings_json}}' diff --git a/roles/windows-terminal/tasks/profiles.yaml b/roles/windows-terminal/tasks/profiles.yaml new file mode 100644 index 0000000..6c8d430 --- /dev/null +++ b/roles/windows-terminal/tasks/profiles.yaml @@ -0,0 +1,5 @@ +--- +# TODO: defaults +# TODO: modify powershell commandline +# TODO: modify command prompt commandline +# TODO: modify debian icon diff --git a/roles/windows-terminal/vars/main.yaml b/roles/windows-terminal/vars/main.yaml new file mode 100644 index 0000000..ec17759 --- /dev/null +++ b/roles/windows-terminal/vars/main.yaml @@ -0,0 +1,5 @@ +--- +windows_terminal_local_app_data: + '{{ansible_env.LOCALAPPDATA}}/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe' +windows_terminal_settings_json: + '{{windows_terminal_local_app_data}}/LocalState/settings.json' diff --git a/windows.yaml b/windows.yaml index 19317fa..d2ff04a 100644 --- a/windows.yaml +++ b/windows.yaml @@ -27,3 +27,4 @@ - role: 1password - role: autohotkey - role: firefox + - role: windows-terminal