How can I make i3wm bind multitouch gesture to change desktop?

i3-wm doesn't support multitouch gestures by default, so an external tool which can detect them and then fire off commands is needed.

I did some quick reading of the archwiki for libinput: https://wiki.archlinux.org/index.php/Libinput

  1. Install libinput-gestures from the aur
  2. Add yourself as a member of the input group to have permission to read the touchpad device: sudo gpasswd -a $USER input
  3. Add these two lines or a variation of them to the ~/.config/libinput-gestures.conf file:
gesture swipe up 3 i3-msg workspace prev
gesture swipe down 3 i3-msg workspace next
  1. Log out of your session completely or simply reboot.
  2. Start the libinput daemon:
libinput-gestures-setup autostart
libinput-gestures-setup start

For me step 5 of @enetheru didn't work as intended and libinput-gestures-setup didn't start up automatically on reboot. But I fixed it by simply activating the gestures in i3 config file as follows:

exec --no-startup-id libinput-gestures-setup start