Add windows-terminal role for Windows

This commit is contained in:
Kenneth Benzie 2022-05-23 21:10:46 +01:00
parent 1117ca00f7
commit 7642c62ecf
5 changed files with 59 additions and 0 deletions

View File

@ -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})}}'

View File

@ -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}}'

View File

@ -0,0 +1,5 @@
---
# TODO: defaults
# TODO: modify powershell commandline
# TODO: modify command prompt commandline
# TODO: modify debian icon

View File

@ -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'

View File

@ -27,3 +27,4 @@
- role: 1password - role: 1password
- role: autohotkey - role: autohotkey
- role: firefox - role: firefox
- role: windows-terminal