Add windows-terminal role for Windows
This commit is contained in:
parent
1117ca00f7
commit
7642c62ecf
31
roles/windows-terminal/tasks/actions.yaml
Normal file
31
roles/windows-terminal/tasks/actions.yaml
Normal 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})}}'
|
17
roles/windows-terminal/tasks/main.yaml
Normal file
17
roles/windows-terminal/tasks/main.yaml
Normal 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}}'
|
5
roles/windows-terminal/tasks/profiles.yaml
Normal file
5
roles/windows-terminal/tasks/profiles.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# TODO: defaults
|
||||||
|
# TODO: modify powershell commandline
|
||||||
|
# TODO: modify command prompt commandline
|
||||||
|
# TODO: modify debian icon
|
5
roles/windows-terminal/vars/main.yaml
Normal file
5
roles/windows-terminal/vars/main.yaml
Normal 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'
|
@ -27,3 +27,4 @@
|
|||||||
- role: 1password
|
- role: 1password
|
||||||
- role: autohotkey
|
- role: autohotkey
|
||||||
- role: firefox
|
- role: firefox
|
||||||
|
- role: windows-terminal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user