[Bin, Awesome] Add touchpad tapping toggling

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

View File

@ -956,6 +956,8 @@
<<gen-sc-glob(sc-screen)>>,
-- Tags
<<gen-sc-glob(sc-tag)>>,
-- Misc
<<gen-sc-glob(sc-misc)>>,
<<sc-tag-num-gen()>>
)
root.keys(globalkeys)
@ -1154,6 +1156,20 @@
| Number | modkey, shift | move_focused_to_tag_n( | move focused client to tag # | tag |
| Number | modkey, control, shift | toggle_focused_client_to_tag_n( | Toggle focused client on tag # | tag |
** Misc
:PROPERTIES:
:CUSTOM_ID: Keybindings-Misc-0b45ce02
:END:
In this category you will find other keybindings that do not fit in other
categories. For now, the only keybinding that is in this category is for
toggling the touchpads tapping ability. This is linked to a special script I
wrote [[file:bin.org::#Toggle_touchpad_tapping-23348b00][here]].
#+NAME: sc-misc
| Key | Modifiers | Lambda? | Action | What it does | Group |
|--------------------+-----------+---------+-----------+-------------------------+-------|
| XF86TouchpadToggle | | shell | tttapping | toggle touchpad tapping | misc |
* Rules
:PROPERTIES:
:CUSTOM_ID: Rules-c6142cdf

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