File tree Expand file tree Collapse file tree 21 files changed +150
-30
lines changed Expand file tree Collapse file tree 21 files changed +150
-30
lines changed Original file line number Diff line number Diff line change 11* .retry
2+ . * .swp
Original file line number Diff line number Diff line change 55 "*.retry" : true
66 },
77 "files.associations" : {
8- "*.yaml" : " ansible"
8+ "*.yaml" : " ansible"
99 }
1010}
Original file line number Diff line number Diff line change 33 connection : local
44
55 tasks :
6+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7+
68 - name : Install Alacritty (Pop!_OS)
79 become : yes
810 apt :
911 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"
1113
1214 - name : Install Alacritty (Ubuntu)
1315 become : yes
1416 apt :
1517 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 33 connection : local
44
55 tasks :
6+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7+
68 - name : Ensure Alacritty configuration folder exists
79 file :
810 path : ~/.config/alacritty
911 state : directory
12+ when : not is_wsl
1013
1114 - name : Update ~/.config/alacritty/alacritty.yml
1215 copy :
215218 - { key: F11, mods: Super, chars: "\x1b[23;3~" }
216219 - { key: F12, mods: Super, chars: "\x1b[24;3~" }
217220 - { key: NumpadEnter, chars: "\n" }
221+ when : not is_wsl
Original file line number Diff line number Diff line change 66 connection : local
77
88 tasks :
9+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
10+
911 - name : Install pre-requisites
1012 become : yes
1113 apt :
1214 package :
1315 - libgconf-2-4
1416 - libgnome-keyring-common
1517 - libgnome-keyring-dev
18+ when : not is_wsl
1619
1720 - name : Create Storage Explorer download location
1821 become : yes
1922 file :
2023 path : /opt/microsoft/storage-explorer
2124 state : directory
25+ when : not is_wsl
2226
2327 - name : Download Storage Explorer
2428 become : yes
2731 dest : /opt/microsoft/storage-explorer
2832 remote_src : yes
2933 creates : /opt/microsoft/storage-explorer/StorageExplorer
34+ when : not is_wsl
3035
3136 - name : Ensure local applications folder exists
3237 become : yes
3338 file :
3439 path : /usr/local/share/applications
3540 state : directory
41+ when : not is_wsl
3642
3743 - name : Add Storage Explorer desktop file
3844 become : yes
3945 copy :
4046 src : storage-explorer.desktop
4147 dest : /usr/local/share/applications/storage-explorer.desktop
48+ when : not is_wsl
Original file line number Diff line number Diff line change 7171 path : ~/.bashrc
7272 marker : " ### {mark} Ansible managed: prompt enhancement"
7373 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
7487 # 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
84100
85101 # Force newline when things don't end cleanly
86102 clear_newline() {
Original file line number Diff line number Diff line change 1717 url : https://extensions.gnome.org/extension-data/topicons-redux%40pop-planet.info.v6.shell-extension.zip
1818
1919 tasks :
20+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
21+
2022 - name : Create GNOME extension directory
2123 file :
2224 path : ~/.local/share/gnome-shell/extensions/{{ item.name }}
2325 state : directory
2426 register : new_extensions
2527 loop : " {{ gnome_extensions }}"
28+ when : not is_wsl
2629
2730 - name : Extract GNOME extension
2831 unarchive :
3134 creates : " ~/.local/share/gnome-shell/extensions/{{ item.item.name }}/metadata.json"
3235 remote_src : yes
3336 loop : " {{ new_extensions.results }}"
34- when : item.changed
37+ when : not is_wsl and item.changed
3538
3639 - name : Enable GNOME extension
3740 command : gnome-shell-extension-tool -e "{{ item.item.name }}"
3841 loop : " {{ new_extensions.results }}"
39- when : item.changed
42+ when : not is_wsl and item.changed
4043
4144 - name : Install Ubuntu Mono Nerd Fonts
4245 become : yes
5457 apt_key :
5558 keyserver : hkp://keyserver.ubuntu.com:80
5659 id : 89993A70
60+ when : not is_wsl
5761
5862 - name : Add Gnome themes APT package repository
5963 become : yes
6266 filename : snwh
6367 update_cache : no
6468 register : apt_repository
69+ when : not is_wsl
6570
6671 - name : Update APT package list
6772 become : yes
6873 apt :
6974 update_cache : yes
70- when : apt_repository.changed
75+ when : not is_wsl and apt_repository.changed
7176 register : apt_update
7277 retries : 5
7378 until : apt_update is success
7883 package :
7984 - numix-gtk-theme
8085 - paper-icon-theme
86+ when : not is_wsl
8187
8288 - name : Install PIP
8389 become : yes
8490 apt :
8591 package :
8692 - python-pip
8793 - python3-pip
94+ when : not is_wsl
8895
8996 - name : Install psutil Python package
9097 become : yes
9198 pip :
9299 name : psutil
100+ when : not is_wsl
93101
94102 - name : Update customization with dconf
95103 dconf :
326334 value : " true"
327335 - key : /org/gnome/shell/keybindings/open-application-menu
328336 value : " @as []"
337+ when : not is_wsl
Original file line number Diff line number Diff line change 33 connection : local
44
55 tasks :
6+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7+
68 - name : Add Google APT package key
79 become : yes
810 apt_key :
911 url : https://dl.google.com/linux/linux_signing_key.pub
12+ when : not is_wsl
1013
1114 - name : Add Google Chrome APT package repository
1215 become : yes
1518 filename : google-chrome
1619 update_cache : no
1720 register : apt_repository
21+ when : not is_wsl
1822
1923 - name : Update APT package list
2024 become : yes
2125 apt :
2226 update_cache : yes
23- when : apt_repository.changed
27+ when : not is_wsl and apt_repository.changed
2428 register : apt_update
2529 retries : 5
2630 until : apt_update is success
2933 become : yes
3034 apt :
3135 package : google-chrome-stable
36+ when : not is_wsl
Original file line number Diff line number Diff line change 33 connection : local
44
55 tasks :
6+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
7+
68 - name : Add Insync APT package key
79 become : yes
810 apt_key :
911 keyserver : hkp://keyserver.ubuntu.com:80
1012 id : ACCAF35C
13+ when : not is_wsl
1114
1215 - name : Add Insync APT package repository
1316 become : yes
1619 filename : insync
1720 update_cache : no
1821 register : apt_repository
22+ when : not is_wsl
1923
2024 - name : Update APT package list
2125 become : yes
2226 apt :
2327 update_cache : yes
24- when : apt_repository.changed
28+ when : not is_wsl and apt_repository.changed
2529 register : apt_update
2630 retries : 5
2731 until : apt_update is success
3236 package :
3337 - insync
3438 - insync-nautilus
35-
39+ when : not is_wsl
Original file line number Diff line number Diff line change 66 toolbox_ver : 1.14.5179
77
88 tasks :
9+ - set_fact : is_wsl={{ lookup('file', '/proc/version') is search('microsoft') }}
10+
911 - name : Determine if Toolbox is installed
1012 stat :
1113 path : /usr/local/bin/jetbrains-toolbox
1214 register : toolbox_path
15+ when : not is_wsl
1316
1417 - block :
1518
3740 - name : Launch Jetbrains Toolbox (first run experience)
3841 command : jetbrains-toolbox
3942
40- when : toolbox_path.stat.exists == False
43+ when : not is_wsl and toolbox_path.stat.exists == False
You can’t perform that action at this time.
0 commit comments