forked from bradwilson/ansible-dev-pc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomization-ui.yaml
474 lines (438 loc) · 19.3 KB
/
customization-ui.yaml
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
- name: Core OS customization (Gnome UI)
hosts: 127.0.0.1
connection: local
vars:
dconf_config:
# Themes
- key: /org/gnome/desktop/interface/cursor-theme
value: "'Paper'"
- key: /org/gnome/desktop/interface/gtk-theme
value: "'Numix'"
- key: /org/gnome/desktop/interface/icon-theme
value: "'Paper'"
- key: /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/use-theme-colors
value: "false"
# Fonts
- key: /org/gnome/desktop/interface/monospace-font-name
value: "'UbuntuMono Nerd Font Mono 12'"
# UI tweaks
- key: /org/gnome/desktop/interface/enable-animations
value: "false"
- key: /org/gnome/desktop/interface/show-battery-percentage
value: "true"
- key: /org/gnome/desktop/sound/allow-volume-above-100-percent
value: "true"
- key: /org/gnome/desktop/wm/preferences/button-layout
value: "'appmenu:minimize,maximize,close'"
- key: /org/gnome/desktop/wm/preferences/num-workspaces
value: "1"
- key: /org/gnome/mutter/dynamic-workspaces
value: "false"
- key: /org/gnome/settings-daemon/plugins/xsettings/antialiasing
value: "'grayscale'"
- key: /org/gnome/shell/favorite-apps
value: "['alacritty.desktop', 'microsoft-edge-beta.desktop', 'postman.desktop', 'slack.desktop', 'Zoom.desktop', 'virt-manager.desktop', 'code.desktop', 'jetbrains-rider.desktop', 'jetbrains-pycharm-ce.desktop', 'org.remmina.Remmina.desktop']"
- key: /org/gnome/shell/extensions/desktop-icons/show-home
value: "false"
- key: /org/gnome/shell/extensions/desktop-icons/show-trash
value: "true"
# Keyboard & mouse settings
- key: /org/gnome/desktop/peripherals/keyboard/delay
value: "@u 250"
- key: /org/gnome/desktop/peripherals/keyboard/repeat-interval
value: "@u 25"
- key: /org/gnome/desktop/peripherals/mouse/accel-profile
value: "'adaptive'"
# Keyboard shortcuts
- key: /org/gnome/desktop/wm/keybindings/activate-window-menu
value: "['<Alt>space']"
- key: /org/gnome/desktop/wm/keybindings/always-on-top
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/begin-move
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/begin-resize
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/close
value: "['<Alt>F4']"
- key: /org/gnome/desktop/wm/keybindings/cycle-group
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/cycle-group-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/cycle-panels
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/cycle-panels-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/cycle-windows
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/cycle-windows-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/lower
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/maximize-horizontally
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/maximize
value: "['<Super>Up']"
- key: /org/gnome/desktop/wm/keybindings/maximize-vertically
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/minimize
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-center
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-corner-ne
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-corner-nw
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-corner-se
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-corner-sw
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-monitor-down
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-monitor-left
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-monitor-right
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-monitor-up
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-side-e
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-side-n
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-side-s
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-side-w
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-10
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-11
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-12
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-1
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-2
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-3
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-4
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-5
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-6
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-7
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-8
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-9
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-down
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-last
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-left
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-right
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/move-to-workspace-up
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/panel-main-menu
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/panel-run-dialog
value: "['<Super>r']"
- key: /org/gnome/desktop/wm/keybindings/raise
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/raise-or-lower
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/set-spew-mark
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/show-desktop
value: "['<Super>m']"
- key: /org/gnome/desktop/wm/keybindings/switch-applications
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-applications-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-group
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-group-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-input-source
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-input-source-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-panels
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-panels-backward
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-10
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-11
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-12
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-1
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-2
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-3
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-4
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-5
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-6
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-7
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-8
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-9
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-down
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-last
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-left
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-right
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-to-workspace-up
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/switch-windows
value: "['<Alt>Tab']"
- key: /org/gnome/desktop/wm/keybindings/switch-windows-backward
value: "['<Shift><Alt>Tab']"
- key: /org/gnome/desktop/wm/keybindings/toggle-above
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/toggle-fullscreen
value: "['<Super>f']"
- key: /org/gnome/desktop/wm/keybindings/toggle-maximized
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/toggle-on-all-workspaces
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/toggle-shaded
value: "@as []"
- key: /org/gnome/desktop/wm/keybindings/unmaximize
value: "['<Super>Down']"
- key: /org/gnome/mutter/keybindings/toggle-tiled-left
value: "['<Super>Left']"
- key: /org/gnome/mutter/keybindings/toggle-tiled-right
value: "['<Super>Right']"
- key: /org/gnome/settings-daemon/plugins/media-keys/home
value: "'<Super>e'"
- key: /org/gnome/settings/daemon/plugins/media-keys/screensaver
value: "['<Super>l']"
- key: /org/gnome/shell/extensions/emoji-selector/emoji-keybinding
value: "['<Super>Period']"
- key: /org/gnome/shell/extensions/emoji-selector/use-keybinding
value: "true"
- key: /org/gnome/shell/keybindings/open-application-menu
value: "@as []"
- key: /org/gnome/shell/keybindings/toggle-message-tray
value: "@as []"
fonts:
# FiraCode Nerd Font
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Regular/complete/Fira%20Code%20Regular%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Bold/complete/Fira%20Code%20Bold%20Nerd%20Font%20Complete%20Mono.ttf
# Iosevka
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Regular/complete/Iosevka%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Italic/complete/Iosevka%20Italic%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Bold/complete/Iosevka%20Bold%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Bold-Italic/complete/Iosevka%20Bold%20Italic%20Nerd%20Font%20Complete%20Mono.ttf
# JetBrainsMono Nerd Font
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Italic/complete/JetBrains%20Mono%20Italic%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Bold/complete/JetBrains%20Mono%20Bold%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/BoldItalic/complete/JetBrains%20Mono%20Bold%20Italic%20Nerd%20Font%20Complete%20Mono.ttf
# UbuntuMono Nerd Font
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/UbuntuMono/Regular/complete/Ubuntu%20Mono%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/UbuntuMono/Regular-Italic/complete/Ubuntu%20Mono%20Italic%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/UbuntuMono/Bold/complete/Ubuntu%20Mono%20Bold%20Nerd%20Font%20Complete%20Mono.ttf
- https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/UbuntuMono/Bold-Italic/complete/Ubuntu%20Mono%20Bold%20Italic%20Nerd%20Font%20Complete%20Mono.ttf
fonts_apt:
- fonts-crosextra-carlito
- fonts-crosextra-caladea
gnome_extensions:
# Dash to Panel (Windows-style bottom task bar)
- name: [email protected]
url: https://extensions.gnome.org/extension-data/dash-to-paneljderose9.github.com.v19.shell-extension.zip
# Emoji Selector
- name: [email protected]
url: https://extensions.gnome.org/extension-data/emoji-selectormaestroschan.fr.v15.shell-extension.zip
# TopIcons Redux (shows legacy app icons in Gnome 3)
- name: [email protected]
url: https://extensions.gnome.org/extension-data/topicons-redux%40pop-planet.info.v6.shell-extension.zip
is_debian: "{{ ansible_distribution == 'Debian' }}"
is_mac: "{{ ansible_distribution == 'MacOSX' }}"
is_ubuntu: "{{ ansible_distribution == 'Ubuntu' or ansible_distribution == 'Pop!_OS' }}"
is_ubuntu_bionic: "{{ ansible_distribution_release == 'bionic' }}"
snwh_ppa_distribution_release_fallback:
'impish': 'focal'
tasks:
- set_fact: is_wsl={{ not is_mac and lookup('file', '/proc/version') is regex('(M|m)icrosoft') }}
# WSL
- name: Get Windows font path
shell: wslpath "$(cmd.exe /c "echo %WINDIR%" 2>/dev/null)"
register: windir
when: is_wsl
- name: Get user's Windows home path
shell: wslpath "$(cmd.exe /c "echo %USERPROFILE%" 2>/dev/null)"
register: userprofile
when: is_wsl
- name: Link Windows fonts into WSL
become: yes
copy:
dest: /etc/fonts/local.conf
content: |
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>{{ windir.stdout }}/Fonts</dir>
<dir>{{ userprofile.stdout }}/AppData/Local/Microsoft/Windows/Fonts</dir>
</fontconfig>
when: is_wsl
# Linux
- name: Create GNOME extension directory
file:
path: ~/.local/share/gnome-shell/extensions/{{ item.name }}
state: directory
register: new_extensions
loop: "{{ gnome_extensions }}"
when: not is_mac and not is_wsl
- name: Extract GNOME extension
unarchive:
src: "{{ item.item.url }}"
dest: "~/.local/share/gnome-shell/extensions/{{ item.item.name }}"
creates: "~/.local/share/gnome-shell/extensions/{{ item.item.name }}/metadata.json"
remote_src: yes
loop: "{{ new_extensions.results }}"
when: not is_mac and not is_wsl and item.changed
- name: Enable GNOME extension
command: gnome-shell-extension-tool -e "{{ item.item.name }}"
loop: "{{ new_extensions.results }}"
when: not is_mac and not is_wsl and item.changed
- name: Install Fonts (via APT)
become: yes
apt:
package: "{{ item }}"
loop: "{{ fonts_apt }}"
when: not is_mac and not is_wsl
- name: Add Debian contrib (main) package source
become: yes
lineinfile:
path: /etc/apt/sources.list
line: deb http://http.us.debian.org/debian {{ ansible_distribution_release }} main contrib non-free
when: is_debian and not is_wsl
- name: Add Debian contrib (security) package source
become: yes
lineinfile:
path: /etc/apt/sources.list
line: deb http://security.debian.org {{ ansible_distribution_release }}/updates main contrib non-free
when: is_debian and not is_wsl
- name: Update APT package list
become: yes
apt:
update_cache: yes
register: apt_update
retries: 5
until: apt_update is success
when: is_debian and not is_wsl
- name: Install Microsoft TTF fonts
become: yes
apt:
package: ttf-mscorefonts-installer
when: not is_mac and not is_wsl
- name: Install Fonts (downloaded)
become: yes
get_url:
url: "{{ item }}"
dest: /usr/local/share/fonts/
loop: "{{ fonts }}"
register: fonts_downloaded
when: not is_mac and not is_wsl
- name: Update font cache
become: yes
command: fc-cache -sv
when: not is_mac and not is_wsl and fonts_downloaded.changed
- name: Add Gnome themes APT package key
become: yes
apt_key:
keyserver: hkp://keyserver.ubuntu.com:80
id: 89993A70
when: not is_mac and not is_wsl
- name: Install Gnome Tweaks
become: yes
apt:
package: gnome-tweaks
when: not is_mac and not is_wsl
- name: Enable chrome-gnome-shell
become: yes
apt:
package: chrome-gnome-shell
when: not is_mac and not is_wsl
- name: Install numix Gnome theme
become: yes
apt:
package: numix-gtk-theme
when: not is_mac and not is_wsl
- name: Add paper Gnome icon theme APT package source
become: yes
apt_repository:
repo: deb http://ppa.launchpad.net/snwh/ppa/ubuntu {{ snwh_ppa_distribution_release_fallback[ansible_distribution_release] | default(ansible_distribution_release) }} main
filename: ppa_snwh_ppa_{{ snwh_ppa_distribution_release_fallback[ansible_distribution_release] | default(ansible_distribution_release) }}
update_cache: no
register: apt_repository
when: is_ubuntu and not is_wsl
- name: Update APT package list
become: yes
apt:
update_cache: yes
when: is_ubuntu and not is_wsl and apt_repository.changed
register: apt_update
retries: 5
until: apt_update is success
- name: Install paper Gnome icon theme (Ubuntu)
become: yes
apt:
package: "{{ item }}"
loop:
- paper-icon-theme
when: is_ubuntu and not is_wsl
- name: Download paper Gnome icon theme
get_url:
url: https://snwh.org/paper/download.php?owner=snwh&ppa=ppa&pkg=paper-icon-theme,18.04
dest: /tmp/paper-icon-theme.deb
when: is_debian and not is_wsl
- name: Install paper Gnome icon theme (Debian)
become: yes
apt:
deb: /tmp/paper-icon-theme.deb
when: is_debian and not is_wsl
- name: Install PIP 2 (Ubuntu 18.04)
become: yes
apt:
package: python-pip
when: is_ubuntu_bionic
- name: Install PIP 3
become: yes
apt:
package: python3-pip
when: not is_mac and not is_wsl
- name: Install psutil Python package
become: yes
pip:
name: psutil
when: not is_mac and not is_wsl
- name: Update customization with dconf
dconf:
key: "{{ item.key }}"
value: "{{ item.value }}"
loop: "{{ dconf_config }}"
when: not is_mac and not is_wsl
# macOS
- name: Install Fonts (macOS)
get_url:
url: "{{ item }}"
dest: ~/Library/Fonts/
loop: "{{ fonts }}"
when: is_mac