File tree 21 files changed +150
-30
lines changed
21 files changed +150
-30
lines changed Original file line number Diff line number Diff line change 1
1
* .retry
2
+ . * .swp
Original file line number Diff line number Diff line change 5
5
"*.retry" : true
6
6
},
7
7
"files.associations" : {
8
- "*.yaml" : " ansible"
8
+ "*.yaml" : " ansible"
9
9
}
10
10
}
Original file line number Diff line number Diff line change 3
3
connection : local
4
4
5
5
tasks :
6
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7
+
6
8
- name : Install Alacritty (Pop!_OS)
7
9
become : yes
8
10
apt :
9
11
package : alacritty
10
- when : " 'Pop!_OS' in hostvars[inventory_hostname].ansible_facts.lsb.description"
12
+ when : " not is_wsl and 'Pop!_OS' in hostvars[inventory_hostname].ansible_facts.lsb.description"
11
13
12
14
- name : Install Alacritty (Ubuntu)
13
15
become : yes
14
16
apt :
15
17
deb : https://github.com/jwilm/alacritty/releases/download/v0.3.2/Alacritty-v0.3.2-ubuntu_18_04_amd64.deb
16
- when : " 'Pop!_OS' not in hostvars[inventory_hostname].ansible_facts.lsb.description"
18
+ when : " not is_wsl and 'Pop!_OS' not in hostvars[inventory_hostname].ansible_facts.lsb.description"
Original file line number Diff line number Diff line change 3
3
connection : local
4
4
5
5
tasks :
6
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7
+
6
8
- name : Ensure Alacritty configuration folder exists
7
9
file :
8
10
path : ~/.config/alacritty
9
11
state : directory
12
+ when : not is_wsl
10
13
11
14
- name : Update ~/.config/alacritty/alacritty.yml
12
15
copy :
215
218
- { key: F11, mods: Super, chars: "\x1b[23;3~" }
216
219
- { key: F12, mods: Super, chars: "\x1b[24;3~" }
217
220
- { key: NumpadEnter, chars: "\n" }
221
+ when : not is_wsl
Original file line number Diff line number Diff line change 6
6
connection : local
7
7
8
8
tasks :
9
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
10
+
9
11
- name : Install pre-requisites
10
12
become : yes
11
13
apt :
12
14
package :
13
15
- libgconf-2-4
14
16
- libgnome-keyring-common
15
17
- libgnome-keyring-dev
18
+ when : not is_wsl
16
19
17
20
- name : Create Storage Explorer download location
18
21
become : yes
19
22
file :
20
23
path : /opt/microsoft/storage-explorer
21
24
state : directory
25
+ when : not is_wsl
22
26
23
27
- name : Download Storage Explorer
24
28
become : yes
27
31
dest : /opt/microsoft/storage-explorer
28
32
remote_src : yes
29
33
creates : /opt/microsoft/storage-explorer/StorageExplorer
34
+ when : not is_wsl
30
35
31
36
- name : Ensure local applications folder exists
32
37
become : yes
33
38
file :
34
39
path : /usr/local/share/applications
35
40
state : directory
41
+ when : not is_wsl
36
42
37
43
- name : Add Storage Explorer desktop file
38
44
become : yes
39
45
copy :
40
46
src : storage-explorer.desktop
41
47
dest : /usr/local/share/applications/storage-explorer.desktop
48
+ when : not is_wsl
Original file line number Diff line number Diff line change 71
71
path : ~/.bashrc
72
72
marker : " ### {mark} Ansible managed: prompt enhancement"
73
73
block : |
74
+ # Set up support for X server in WSL
75
+ if [ -z "$WSL_DISTRO_NAME" ]; then
76
+ # Write current path in the terminal title bar
77
+ function writeCwdInTitlebar() {
78
+ case "$TERM" in
79
+ xterm*|rxvt*)
80
+ echo -ne "\e]0;`whoami`@`hostname`$([ -z "$WSL_DISTRO_NAME" ] || echo -n " (WSL: $WSL_DISTRO_NAME)"): `dirs +0`\a"
81
+ ;;
82
+ *)
83
+ ;;
84
+ esac
85
+ }
86
+ else
74
87
# Write current path in the terminal title bar
75
- function writeCwdInTitlebar() {
76
- case "$TERM" in
77
- xterm*|rxvt*)
78
- echo -ne "\e]0;`whoami`@`hostname`: `dirs +0`\a"
79
- ;;
80
- *)
81
- ;;
82
- esac
83
- }
88
+ function writeCwdInTitlebar() {
89
+ case "$TERM" in
90
+ xterm*|rxvt*)
91
+ echo -ne "\e]0;[WSL] $WSL_DISTRO_NAME: `dirs +0`\a"
92
+ ;;
93
+ *)
94
+ ;;
95
+ esac
96
+ }
97
+
98
+ export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
99
+ fi
84
100
85
101
# Force newline when things don't end cleanly
86
102
clear_newline() {
Original file line number Diff line number Diff line change 17
17
url : https://extensions.gnome.org/extension-data/topicons-redux%40pop-planet.info.v6.shell-extension.zip
18
18
19
19
tasks :
20
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
21
+
20
22
- name : Create GNOME extension directory
21
23
file :
22
24
path : ~/.local/share/gnome-shell/extensions/{{ item.name }}
23
25
state : directory
24
26
register : new_extensions
25
27
loop : " {{ gnome_extensions }}"
28
+ when : not is_wsl
26
29
27
30
- name : Extract GNOME extension
28
31
unarchive :
31
34
creates : " ~/.local/share/gnome-shell/extensions/{{ item.item.name }}/metadata.json"
32
35
remote_src : yes
33
36
loop : " {{ new_extensions.results }}"
34
- when : item.changed
37
+ when : not is_wsl and item.changed
35
38
36
39
- name : Enable GNOME extension
37
40
command : gnome-shell-extension-tool -e "{{ item.item.name }}"
38
41
loop : " {{ new_extensions.results }}"
39
- when : item.changed
42
+ when : not is_wsl and item.changed
40
43
41
44
- name : Install Ubuntu Mono Nerd Fonts
42
45
become : yes
54
57
apt_key :
55
58
keyserver : hkp://keyserver.ubuntu.com:80
56
59
id : 89993A70
60
+ when : not is_wsl
57
61
58
62
- name : Add Gnome themes APT package repository
59
63
become : yes
62
66
filename : snwh
63
67
update_cache : no
64
68
register : apt_repository
69
+ when : not is_wsl
65
70
66
71
- name : Update APT package list
67
72
become : yes
68
73
apt :
69
74
update_cache : yes
70
- when : apt_repository.changed
75
+ when : not is_wsl and apt_repository.changed
71
76
register : apt_update
72
77
retries : 5
73
78
until : apt_update is success
78
83
package :
79
84
- numix-gtk-theme
80
85
- paper-icon-theme
86
+ when : not is_wsl
81
87
82
88
- name : Install PIP
83
89
become : yes
84
90
apt :
85
91
package :
86
92
- python-pip
87
93
- python3-pip
94
+ when : not is_wsl
88
95
89
96
- name : Install psutil Python package
90
97
become : yes
91
98
pip :
92
99
name : psutil
100
+ when : not is_wsl
93
101
94
102
- name : Update customization with dconf
95
103
dconf :
326
334
value : " true"
327
335
- key : /org/gnome/shell/keybindings/open-application-menu
328
336
value : " @as []"
337
+ when : not is_wsl
Original file line number Diff line number Diff line change 3
3
connection : local
4
4
5
5
tasks :
6
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7
+
6
8
- name : Add Google APT package key
7
9
become : yes
8
10
apt_key :
9
11
url : https://dl.google.com/linux/linux_signing_key.pub
12
+ when : not is_wsl
10
13
11
14
- name : Add Google Chrome APT package repository
12
15
become : yes
15
18
filename : google-chrome
16
19
update_cache : no
17
20
register : apt_repository
21
+ when : not is_wsl
18
22
19
23
- name : Update APT package list
20
24
become : yes
21
25
apt :
22
26
update_cache : yes
23
- when : apt_repository.changed
27
+ when : not is_wsl and apt_repository.changed
24
28
register : apt_update
25
29
retries : 5
26
30
until : apt_update is success
29
33
become : yes
30
34
apt :
31
35
package : google-chrome-stable
36
+ when : not is_wsl
Original file line number Diff line number Diff line change 3
3
connection : local
4
4
5
5
tasks :
6
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7
+
6
8
- name : Add Insync APT package key
7
9
become : yes
8
10
apt_key :
9
11
keyserver : hkp://keyserver.ubuntu.com:80
10
12
id : ACCAF35C
13
+ when : not is_wsl
11
14
12
15
- name : Add Insync APT package repository
13
16
become : yes
16
19
filename : insync
17
20
update_cache : no
18
21
register : apt_repository
22
+ when : not is_wsl
19
23
20
24
- name : Update APT package list
21
25
become : yes
22
26
apt :
23
27
update_cache : yes
24
- when : apt_repository.changed
28
+ when : not is_wsl and apt_repository.changed
25
29
register : apt_update
26
30
retries : 5
27
31
until : apt_update is success
32
36
package :
33
37
- insync
34
38
- insync-nautilus
35
-
39
+ when : not is_wsl
Original file line number Diff line number Diff line change 6
6
toolbox_ver : 1.14.5179
7
7
8
8
tasks :
9
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
10
+
9
11
- name : Determine if Toolbox is installed
10
12
stat :
11
13
path : /usr/local/bin/jetbrains-toolbox
12
14
register : toolbox_path
15
+ when : not is_wsl
13
16
14
17
- block :
15
18
37
40
- name : Launch Jetbrains Toolbox (first run experience)
38
41
command : jetbrains-toolbox
39
42
40
- when : toolbox_path.stat.exists == False
43
+ when : not is_wsl and toolbox_path.stat.exists == False
Original file line number Diff line number Diff line change 3
3
connection : local
4
4
5
5
tasks :
6
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7
+
6
8
- name : Install QEMU/KVM
7
9
become : yes
8
10
apt :
13
15
- ovmf
14
16
- qemu-kvm
15
17
- virt-manager
18
+ when : not is_wsl
16
19
17
20
- name : Enable QEMU/KVM for current user
18
21
become : yes
19
22
user :
20
23
name={{ lookup('env', "USER") }}
21
24
groups=libvirt
22
25
append=yes
26
+ when : not is_wsl
Original file line number Diff line number Diff line change 5
5
connection : local
6
6
7
7
tasks :
8
+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
9
+
8
10
- name : Create extension directory
9
11
file :
10
12
path : ~/.local/share/gnome-shell/extensions/no-screen-blank@localhost
11
13
state : directory
12
14
register : folder
15
+ when : not is_wsl
13
16
14
17
- name : Copy extension code
15
18
copy :
16
19
src : extension.js
17
20
dest : ~/.local/share/gnome-shell/extensions/no-screen-blank@localhost
18
- when : folder.changed
21
+ when : not is_wsl and folder.changed
19
22
20
23
- name : Get GNOME shell version
21
24
shell : gnome-shell --version
22
- when : folder.changed
25
+ when : not is_wsl and folder.changed
23
26
register : gnome_shell_raw
24
27
25
28
- name : Extraction GNOME shell version
26
29
set_fact :
27
30
gnome_shell_version : " {{ gnome_shell_raw.stdout | regex_search(regexp, '\\ 1') }}"
28
31
vars :
29
32
regexp : ' GNOME Shell ((\d+)\.(\d+))\.\d+'
30
- when : folder.changed
33
+ when : not is_wsl and folder.changed
31
34
32
35
- name : Create extension manifest
33
36
blockinfile :
41
44
"uuid": "no-screen-blank@localhost",
42
45
"name": "No Screen Blank",
43
46
"description": "Disable blanking the screen after showing the lock screen"
44
- when : folder.changed
47
+ when : not is_wsl and folder.changed
45
48
register : metadata
46
49
47
50
- name : Enable extension
48
51
command : gnome-shell-extension-tool -e no-screen-blank@localhost
49
- when : folder.changed and metadata.changed
52
+ when : not is_wsl and folder.changed and metadata.changed
You can’t perform that action at this time.
0 commit comments