Don't install xclip or xsel in WSL

Newer WSL2 has issues with `xclip`/`xsel` behaviour which cause Windows
GUI's to freeze waiting for input from an already exited process.
Switching to `win32yank.exe` for clipboard integrations.
This commit is contained in:
Kenneth Benzie 2022-12-03 18:36:56 +00:00
parent da4b8858d3
commit 63ff47c3b2
3 changed files with 49 additions and 6 deletions

View File

@ -3,6 +3,21 @@
pacman: pacman:
name: name:
- tmux - tmux
- xclip
- urlscan - urlscan
state: latest state: latest
- name: install pacman package
when: '"WSL" not in ansible_kernel'
become: true
pacman:
name: xsel
state: latest
- name: remove pacman package
when: '"WSL" in ansible_kernel'
become: true
pacman:
name:
- xclip
- xsel
state: absent

View File

@ -1,12 +1,26 @@
--- ---
- name: install apt packages - name: install apt packages
become: true become: true
package: apt:
name: name:
- tmux - tmux
- gawk - gawk
- jq
- sysstat - sysstat
- urlview - urlview
- xclip
state: latest state: latest
- name: install apt package
when: '"WSL" not in ansible_kernel'
become: true
apt:
name: xsel
state: latest
- name: remove apt package
when: '"WSL" in ansible_kernel'
become: true
apt:
name:
- xclip
- xsel
state: absent

View File

@ -3,8 +3,22 @@
dnf: dnf:
name: name:
- tmux - tmux
- xclip
- urlscan - urlscan
- sysstat - sysstat
- jq
state: latest state: latest
- name: install dnf package
when: '"WSL" not in ansible_kernel'
become: true
dnf:
name: xsel
state: latest
- name: remove dnf package
when: '"WSL" in ansible_kernel'
become: true
dnf:
name:
- xclip
- xsel
state: absent