Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable touchpad on mouse hotplug #98

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
vault_password_file
roles/debian-docker-toolbox
.vagrant
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions roles/system-configs/files/83-mouse-hotplug.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# this rules file must be named 61* or later because it won't work
# unless it runs after '/lib/udev/rules.d/60-persistent-input.rules'
#
# NOTE: will only affect DISPLAY :0
#
# run:
# udevadm test --action=add /sys/devices/platform/i8042/serio1/input/input6/mouse1
# or similar to test the following rules
#

# disable PS/2 touchpad on DISPLAY :0 if a mouse is added to the system
#ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idVendor}=="093a",ATTRS{idProduct}=="2510",RUN+="/usr/bin/xinput --set-prop 'ETPS/2 Elantech Touchpad' 'Device Enabled' 0"
ACTION=="add",SUBSYSTEM=="input",ENV{ID_INPUT_MOUSE}=="1",RUN+="/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop ETPS\/2\ Elantech\ Touchpad Device\ Enabled 0'"

# enable PS/2 touchpad on DISPLAY :0 if a mouse is added to the system
#ACTION=="remove",SUBSYSTEMS=="usb",ATTRS{idVendor}=="093a",ATTRS{idProduct}=="2510",RUN+="/usr/bin/xinput --set-prop 'ETPS/2 Elantech Touchpad' 'Device Enabled' 1"
ACTION=="add",SUBSYSTEM=="input",ENV{ID_INPUT_MOUSE}=="1",RUN+="/bin/sh -c 'DISPLAY=:0 /usr/bin/xinput --set-prop ETPS\/2\ Elantech\ Touchpad Device\ Enabled 1'"
4 changes: 4 additions & 0 deletions roles/system-configs/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
- name: clear font cache
become: true
shell: fc-cache -vf /usr/share/fonts

- name: udev reload rules
become: true
shell: udevadm control --reload
10 changes: 10 additions & 0 deletions roles/system-configs/tasks/Archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@
--sort rate
--save /etc/pacman.d/mirrorlist
tags: cron

- name: Notebook configurations
block:
- name: deploy udev rule to disable touchpad on mouse hotplug
become: true
copy:
src: 83-mouse-hotplug.rule
dest: /etc/udev/rules.d/83-mouse-hotplug.rule
notify: udev reload rules
when: ansible_form_factor == "Notebook"