From 91945e8966971eea6cdc1a4e2c3e1e41e2936584 Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Tue, 31 Oct 2017 21:07:44 -0700 Subject: [PATCH] enable middle-click scroll This transforms x/y movement into scroll events when the middle-click button is held on an input device. It compensates for the less-than-perfect scroll wheel position on my otherwise-great new trackball. Remove the variable, or set it to something other than True, to prevent the task from being run. --- group_vars/all | 2 ++ roles/x/files/30-scroll.conf | 6 ++++++ roles/x/tasks/main.yml | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 roles/x/files/30-scroll.conf diff --git a/group_vars/all b/group_vars/all index ffc28c6..5770dd5 100644 --- a/group_vars/all +++ b/group_vars/all @@ -205,3 +205,5 @@ himawaripy: run_boot_delay: 2min run_on: trusted flags: --auto-offset --level 4 + +middle_click_scroll: True diff --git a/roles/x/files/30-scroll.conf b/roles/x/files/30-scroll.conf new file mode 100644 index 0000000..1e39d0f --- /dev/null +++ b/roles/x/files/30-scroll.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "libinput middle click scroll" + Driver "libinput" + Option "ScrollMethod" "button" + Option "ScrollButton" "2" +EndSection diff --git a/roles/x/tasks/main.yml b/roles/x/tasks/main.yml index aa33877..2ac97f7 100644 --- a/roles/x/tasks/main.yml +++ b/roles/x/tasks/main.yml @@ -24,6 +24,10 @@ - name: Add user to video group user: name={{ user.name }} groups=video append=yes +- name: Enable middle-click scrolling + copy: src=30-scroll.conf dest=/etc/X11/xorg.conf.d/30-scroll.conf + when: middle_click_scroll is defined and middle_click_scroll == True + - include: sxhkd.yml - include: unclutter.yml - include: autorandr.yml