i3 three finger workspace swipe on Ubuntu
I travel a lot and try to carry as little stuff as possible. However, having a second screen is a productivity booster when programming, so i'm carrying a small no-name 15" screen with me.
I was looking for a way to get the productivity boost of a second screen without the extra bulk. I first thought of getting a foot pedal to switch i3 workspaces "without thinking".
However, after discussing with a friend that's on a mac, I realised that a good first step would be to set up touchpad swipe gestures for workspace swiping.
Here's how I got it working on Ubuntu 20.04:
Add yourself to the "input" group
sudo gpasswd -a $USER input
Reboot your computer (required)
Then install the gesture detection script
sudo apt-get install wmctrl xdotool libinput-tools
git clone https://github.com/bulletmark/libinput-gestures.git
cd libinput-gestures
sudo make install
Configure the swipe gestures :
printf "gesture swipe left 3 i3-msg workspace prev\ngesture swipe right 3 i3-msg workspace next\n" > ~/.config/libinput-gestures.conf
Start the script
libinput-gestures-setup autostart start
Try swiping left / right on your touchpad with tree fingers, it should switch workspaces.
For mode details, see the script documentation here (not my own) : https://github.com/bulletmark/libinput-gestures