diff --git a/org/config/awesome.org b/org/config/awesome.org index 906438b..a95e91d 100644 --- a/org/config/awesome.org +++ b/org/config/awesome.org @@ -956,6 +956,8 @@ <>, -- Tags <>, + -- Misc + <>, <> ) 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 touchpad’s 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 diff --git a/org/config/bin.org b/org/config/bin.org index f343499..0d59b9e 100644 --- a/org/config/bin.org +++ b/org/config/bin.org @@ -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. I’m not going to really complain about it since it lets me + program it like I want. Since I often don’t need to completely deactivate the + touchpad, I’ll 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, let’s 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 it’s 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 let’s 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, let’s update the touchpad’s 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