[Bin, Awesome] Add touchpad tapping toggling

XF86ToggleTouchpad is now bound to the new script `tttouchpad'
This commit is contained in:
2020-10-14 18:34:30 +02:00
parent 742b3009a8
commit 6b92c8bc4c
2 changed files with 51 additions and 0 deletions

View File

@@ -1203,6 +1203,41 @@
telnet towel.blinkenlights.nl
#+END_SRC
* Toggle touchpad tapping
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/tttapping
:CUSTOM_ID: Toggle_touchpad_tapping-23348b00
:END:
For some reasons, my firmware does not recognize the function key for toggling
the touchpad. Im not going to really complain about it since it lets me
program it like I want. Since I often dont need to completely deactivate the
touchpad, Ill instead toggle whether tapping is enabled or not when pressing
~XF86TouchpadToggle~. And for that, I need this small script that will
actually toggle it, and it will be used in my window manager configuration.
First, lets detect the current status of the touchpad:
#+BEGIN_SRC fish
set TPSTATUS (xinput list-props 12 | grep "Tapping Enabled" | grep -v "Default" | awk '{print $5}')
#+END_SRC
This will set ~TPSTATUS~ either to ~0~, meaning tapping is disabled, or to
~1~, meaning its enabled. I will consider any other value as being disabled.
#+BEGIN_SRC fish
test $TPSTATUS = "1" && set NEWTPSTATUS 0 || set NEWTPSTATUS 1
#+END_SRC
Now lets declare some variables to make this script more personal. With my
current computer (a Gazelle by System76), the name of my touchpad is the
following:
#+BEGIN_SRC fish
set TPNAME "ELAN0412:00 04F3:3162 Touchpad"
#+END_SRC
Finally, lets update the touchpads options:
#+BEGIN_SRC fish
xinput set-prop $TPNAME "libinput Tapping Enabled" $NEWTPSTATUS
#+END_SRC
* UpdateFlutter
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/UpdateFlutter