Enable xremap on Debian/Ubuntu

This commit is contained in:
Kenneth Benzie 2023-08-17 23:24:03 +01:00
parent cba3f6ce2a
commit afa680c4d1
2 changed files with 20 additions and 4 deletions

View File

@ -5,4 +5,9 @@
roles: roles:
- role: kitty - role: kitty
- role: xremap - role: xremap
when: ansible_os_family == "RedHat" when: >
'GNOME' in ansible_env.XDG_CURRENT_DESKTOP and
ansible_env.XDG_SESSION_TYPE == 'wayland' and (
ansible_os_family == "RedHat" or
ansible_os_family == "Debian"
)

View File

@ -1,7 +1,8 @@
--- ---
- assert: - assert:
that: ansible_env.XDG_CURRENT_DESKTOP == "GNOME" and that: >
ansible_env.XDG_SESSION_TYPE == "wayland" 'GNOME' in ansible_env.XDG_CURRENT_DESKTOP and
ansible_env.XDG_SESSION_TYPE == 'wayland'
- set_fact: - set_fact:
install_dir: '{{ansible_env.HOME}}/.local/bin' install_dir: '{{ansible_env.HOME}}/.local/bin'
@ -35,12 +36,14 @@
set_fact: set_fact:
needs_installed: needs_installed:
'{{not executable.stat.exists or installed_version != latest.json.name}}' '{{not executable.stat.exists or installed_version != latest.json.name}}'
xdg_current_desktop:
"{{ansible_env.XDG_CURRENT_DESKTOP | regex_replace('(.*:)?(.*)', '\\2')}}"
- name: construct asset query - name: construct asset query
set_fact: set_fact:
asset_query: > asset_query: >
[?contains(name, `xremap-linux-{{ansible_architecture}}-{{ [?contains(name, `xremap-linux-{{ansible_architecture}}-{{
ansible_env.XDG_CURRENT_DESKTOP | lower}}.zip`)] | [0] xdg_current_desktop | lower}}.zip`)] | [0]
- name: get release asset - name: get release asset
set_fact: set_fact:
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}' asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
@ -81,6 +84,14 @@
append: true append: true
groups: input groups: input
- name: load the uinput kernel module
when: ansible_os_family == 'Debian'
become: true
copy:
content: |
uinput
dest: /etc/modules-load.d/uinput.conf
# TODO: This works for on Fedora, author uses it on Ubuntu so I assume Debian # TODO: This works for on Fedora, author uses it on Ubuntu so I assume Debian
# will work too. Arch and other distros are potentially different see the docs # will work too. Arch and other distros are potentially different see the docs
# https://github.com/k0kubun/xremap # https://github.com/k0kubun/xremap