-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup-terminator.yml
176 lines (166 loc) · 6.86 KB
/
setup-terminator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# I don't want to put terminator config file directly under version control,
# because I'm often experimenting with new color palettes and tracking these
# changes would be too cumbersome. However, I want to have a "seed" version of
# the config ready for deploying on new machines.
- name: Ensure terminator config contains desired settings
hosts: all
gather_facts: yes
tags: terminator
vars:
conf_dir: "{{ ansible_env.HOME }}/.config/terminator"
tasks:
- name: Install terminator
apt:
name: terminator
become: yes
# I know this works for Ubuntu 20.04
- name: set terminator as default terminal
alternatives:
name: x-terminal-emulator
path: /usr/bin/terminator
- name: ensure .config/terminator directory exists
file:
path: "{{ conf_dir }}"
state: directory
# Inserting block with my settings into default config would not work
# (terminator wouldn't parse that).
- name: check whether the config has proper format
command: grep 'ANSIBLE MANAGED BLOCK' "{{ conf_dir }}/config"
register: grep_result
changed_when: grep_result.rc == 1
failed_when: false # missing config is not a problem
# If this is the first ansible run, replace config file
- name: backup incompatible config
command: >
mv
"{{ conf_dir }}/config"
"{{ conf_dir }}/.config.{{ ansible_date_time.iso8601 }}"
when: grep_result.rc == 1
failed_when: false # missing config is not a problem
- name: template seed Terminator configuration
blockinfile:
dest: "{{ conf_dir }}/config"
backup: yes
create: yes
insertbefore: BOF
block: |
[global_config]
always_split_with_profile = True
suppress_multiple_term_dialog = True
inactive_color_offset = 1.0
scroll_tabbar = True
title_inactive_bg_color = "#637b86"
title_inactive_fg_color = "#072938"
title_receive_bg_color = "#12ab9e"
title_receive_fg_color = "#072938"
title_transmit_bg_color = "#3c8ae6"
title_transmit_fg_color = "#072938"
[keybindings]
broadcast_all = None
close_term = None
close_window = None
switch_to_tab_1 = <Primary>1
switch_to_tab_2 = <Primary>2
switch_to_tab_3 = <Primary>3
switch_to_tab_4 = <Primary>4
switch_to_tab_5 = <Primary>5
switch_to_tab_6 = <Primary>6
[layouts]
[[default]]
[[[child1]]]
type = Terminal
parent = window0
[[[window0]]]
type = Window
parent = ""
[plugins]
[profiles]
[[dark 0.10.1]]
background_color = "#103c48"
background_image = None
cursor_color = "#cad8d9"
font = Ubuntu Mono 12
foreground_color = "#adbcbc"
palette = "#184956:#fa5750:#75b938:#dbb32d:#4695f7:#f275be:#41c7b9:#72898f:#2d5b69:#ff665c:#84c747:#ebc13d:#58a3ff:#ff84cd:#53d6c7:#cad8d9"
scroll_on_output = False
scrollback_infinite = True
scrollbar_position = hidden
use_system_font = False
word_chars = "-A-Za-z0-9,./?%&#_"
[[grey 0.10.1]]
background_color = "#3b3b3b"
background_image = None
cursor_color = "#e5e5e5"
font = Ubuntu Mono 12
foreground_color = "#c6c6c6"
palette = "#484848:#ff5e56:#7cc03f:#e3ba35:#4f9bfe:#fa7cc5:#4acec0:#8f8f8f:#5b5b5b:#ff6d63:#8bcf4e:#f3c945:#61aaff:#ff8bd4:#5cdecf:#e5e5e5"
scroll_on_output = False
scrollback_infinite = True
scrollbar_position = hidden
use_system_font = False
word_chars = "-A-Za-z0-9,./?%&#_"
[[black 0.10.1]]
background_color = "#181818"
background_image = None
cursor_color = "#dedede"
font = Ubuntu Mono 12
foreground_color = "#b9b9b9"
palette = "#252525:#ed4a46:#70b433:#dbb32d:#368aeb:#eb6eb7:#3fc5b7:#777777:#3b3b3b:#e67f43:#83c746:#efc541:#a580e2:#ff81ca:#56d8c9:#dedede"
scroll_on_output = False
scrollback_infinite = True
scrollbar_position = hidden
use_system_font = False
word_chars = "-A-Za-z0-9,./?%&#_"
[[black 0.11.1]]
background_color = "#181818"
background_image = None
cursor_color = "#777777"
font = Ubuntu Mono 12
foreground_color = "#b9b9b9"
palette = "#252525:#ff615d:#4fba36:#e9c326:#06a0f0:#eb82af:#00ccc1:#777777:#3b3b3b:#e78438:#64cd48:#fed53d:#37b2ff:#b88fe9:#0adfd4:#dedede"
scroll_on_output = False
scrollback_infinite = True
scrollbar_position = hidden
use_system_font = False
word_chars = "-A-Za-z0-9,./?%&#_"
[[black 0.11.0]]
background_color = "#181818"
background_image = None
cursor_color = "#dedede"
font = Ubuntu Mono 12
foreground_color = "#b9b9b9"
palette = "#252525:#ff605c:#58b841:#ebc439:#00a1f2:#f681b2:#2fc5be:#777777:#3b3b3b:#fa9548:#62cc48:#ffd63f:#b68ee8:#ff93c0:#00ded3:#dedede"
scroll_on_output = False
scrollback_infinite = True
scrollbar_position = hidden
use_system_font = False
word_chars = "-A-Za-z0-9,./?%&#_"
# I want to set default profile only if it's not present.
- name: check for default profile
command: grep 'BEGIN default profile' "{{ conf_dir }}/config"
register: default_profile
changed_when: default_profile.rc == 1
failed_when: false # missing config is not a problem
- name: template Terminator default profile
when: default_profile.rc == 1
blockinfile:
dest: "{{ conf_dir }}/config"
backup: yes
create: yes
insertafter: EOF
marker: "# {mark} default profile"
block: "{{ selenized_black | indent(width=2, indentfirst=True) }}"
vars:
selenized_black: |
[[default]]
background_color = "#181818"
background_image = None
cursor_color = "#dedede"
font = Ubuntu Mono 12
foreground_color = "#b9b9b9"
palette = "#252525:#ff605c:#58b841:#ebc439:#00a1f2:#f681b2:#2fc5be:#777777:#3b3b3b:#fa9548:#62cc48:#ffd63f:#b68ee8:#ff93c0:#00ded3:#dedede"
scroll_on_output = False
scrollback_infinite = True
scrollbar_position = hidden
use_system_font = False
word_chars = "-A-Za-z0-9,./?%&#_"