Instructions for extra touchpad gestures
#1
If you would like to have page back and page forward gestures (swipe left and right with THREE fingers), pinch to zoom in and out, quickly switch workspaces and more on your Pinebook Pro, look no further! This is how I got mine set up.

BTW I am using Manjaro KDE (Default Debian tutorial below!!!), if you are using something else, YMMV.

Download xdotool
Code:
sudo pacman -S xdotool


Enable AUR and download libinput-gestures

Code:
sudo pacman -S libinput-gestures
make your users config settings file based off the default

Code:
cp /etc/libinput-gestures.conf ~/.config/
Start it up!

Code:
libinput-gestures-setup start
if you want to have it start on every boot.

Code:
libinput-gestures-setup autostart
Enjoy your new fancy three finger swipes to move back and forth between webpages. The config file is very customizable so feel free to get creative. 

EDIT:
If you would also like the ability to switch between workspaces (desktops) with a four finger swipe, jump to beginning and end of webpage, and pinch to zoom in and out, here is the edit:

Code:
# Jump to the beginning of a webpage (three fingers)
gesture swipe down      xdotool key Home

# Jump to the end of a webpage (three fingers)
gesture swipe up        xdotool key End

# Workspace/desktop switch (four fingers)
gesture swipe left      4 _internal ws_up

# Workspace/desktop switch (four fingers)
gesture swipe right     4 _internal ws_down

###############################################################################
# PINCH GESTURES:
###############################################################################

# zoom in
gesture pinch in        xdotool key ctrl+minus

# zoom out
gesture pinch out       xdotool key ctrl+plus

NOTE: the Manjaro ARM KDE image does not have virtual desktops set up by default, you will have to add a second one yourself:
Virtual Desktops -> Add -> edit your new desktop to say 'Desktop 2'. you should now see Desktop 1 and 2 in the list.


DEFAULT DEBIAN TUTORIAL:

Install Dependencies
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install xdotool wmctrl
sudo apt-get install libinput-tools


We are going to have to build it ourselves

Code:
git clone https://github.com/bulletmark/libinput-gestures.git
cd libinput-gestures/
sudo make install


Add this to ~/.config/libinput-gestures.conf (you will have to create this file yourself)

Code:
# Configuration file for libinput-gestures on Pinebook Pro.
# clover, Dec 2019
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# NOTE: This configuration works on Manjaro KDE/Plasma and Debian + MATE if you are using something else YMMV

###############################################################################
# SWIPE GESTURES:
###############################################################################
# Jump to the beginning of a webpage (three fingers)
gesture swipe down      xdotool key Home

# Jump to the end of a webpage (three fingers)
gesture swipe up        xdotool key End

# Browser go forward (three fingers)
gesture swipe left      3 xdotool key alt+Right

# Browser go back (three fingers)
gesture swipe right     3 xdotool key alt+Left

# Workspace/desktop switch (four fingers)
gesture swipe left      4 _internal ws_up

# Workspace/desktop switch (four fingers)
gesture swipe right     4 _internal ws_down

###############################################################################
# PINCH GESTURES:
###############################################################################

# zoom in
gesture pinch in        xdotool key ctrl+minus

# zoom out
gesture pinch out       xdotool key ctrl+plus


We need a client that can run .desktop applications

Code:
sudo apt-get install dex


We can now test our gestures manually
Code:
dex ~/.config/autostart/libinput-gestures.desktop


If you want it to start on every boot create systemd file
Code:
sudo touch /etc/systemd/system/gestures.service

add this to gestures.service:
Code:
[Unit]
Description=gestures

[Service]
Type=simple
ExecStart=/usr/bin/dex /home/rock/.config/autostart/libinput-gestures.desktop

[Install]
WantedBy=multi-user.target


Finally, enable and reboot
Code:
sudo systemctl enable gestures
sudo reboot


Thats it!
  Reply
#2
(12-27-2019, 11:48 PM)clover Wrote: If you would like to have page back and page forward gestures (swipe left and right with THREE fingers) on your Pinebook Pro, look no further! This is how I got mine set up.

BTW I am using Manjaro KDE, if you are using something else, YMMV.

Download xdotool
Code:
sudo pacman -S xdotool


Enable AUR and download libinput-gestures

Code:
sudo pacman -S libinput-gestures
make your users config settings file based off the default

Code:
cp /etc/libinput-gestures.conf ~/.config/
Start it up!

Code:
libinput-gestures-setup start
if you want to have it start on every boot.

Code:
libinput-gestures-setup autostart
Enjoy your new fancy three finger swipes to move back and forth between webpages. The config file is very customizable so feel free to get creative. 

EDIT:
If you would also like the ability to switch between workspaces (desktops) with a four finger swipe,
insert this edit starting line 75:

Code:
# 3 finger Browser go forward (works only for Xorg, and Xwayland clients)
gesture swipe left      3 xdotool key alt+Right
# 4 finger workspace/desktop switch
gesture swipe left      4 xdotool key ctrl+F2
# 3 finger Browser go back (works only for Xorg, and Xwayland clients)
gesture swipe right     3 xdotool key alt+Left
# 4 finger workspace/desktop switch
gesture swipe right     4 xdotool key ctrl+F1

NOTE: the Manjaro ARM KDE image does not have virtual desktops set up by default, you will have to add a second one yourself:
Virtual Desktops -> Add -> edit your new desktop to say 'Desktop 2'. you should now see Desktop 1 and 2 in the list.


Would you have any idea how to get this working on the default Debian image?  I don't know what repo I would need to get libinput installed.
  Reply
#3
(01-18-2020, 11:12 AM)appdev46 Wrote:
(12-27-2019, 11:48 PM)clover Wrote: If you would like to have page back and page forward gestures (swipe left and right with THREE fingers) on your Pinebook Pro, look no further! This is how I got mine set up.

BTW I am using Manjaro KDE, if you are using something else, YMMV.

Download xdotool
Code:
sudo pacman -S xdotool


Enable AUR and download libinput-gestures

Code:
sudo pacman -S libinput-gestures
make your users config settings file based off the default

Code:
cp /etc/libinput-gestures.conf ~/.config/
Start it up!

Code:
libinput-gestures-setup start
if you want to have it start on every boot.

Code:
libinput-gestures-setup autostart
Enjoy your new fancy three finger swipes to move back and forth between webpages. The config file is very customizable so feel free to get creative. 

EDIT:
If you would also like the ability to switch between workspaces (desktops) with a four finger swipe,
insert this edit starting line 75:

Code:
# 3 finger Browser go forward (works only for Xorg, and Xwayland clients)
gesture swipe left      3 xdotool key alt+Right
# 4 finger workspace/desktop switch
gesture swipe left      4 xdotool key ctrl+F2
# 3 finger Browser go back (works only for Xorg, and Xwayland clients)
gesture swipe right     3 xdotool key alt+Left
# 4 finger workspace/desktop switch
gesture swipe right     4 xdotool key ctrl+F1

NOTE: the Manjaro ARM KDE image does not have virtual desktops set up by default, you will have to add a second one yourself:
Virtual Desktops -> Add -> edit your new desktop to say 'Desktop 2'. you should now see Desktop 1 and 2 in the list.


Would you have any idea how to get this working on the default Debian image?  I don't know what repo I would need to get libinput installed.
updated original post
  Reply
#4
This is awesome and should be a tutorial on the PBP wiki! I'll try this right away.
  Reply
#5
Excellent tutorial, thank you
  Reply
#6
I might have done something wrong but I had to copy libinput-gestures.desktop to ~/.config/autostart/

I don't understand the dex part but gestures are working now.

I also swapped swipe left and swipe right. Just a personal preference. Smile

Thanks!
  Reply
#7
I just noticed that gestures no longer work after waking from sleep.

Any suggestions on what could be the issue?
  Reply
#8
(01-22-2020, 06:09 PM)appdev46 Wrote: I just noticed that gestures no longer work after waking from sleep.  

Any suggestions on what could be the issue?

Please post your output from this command:


Code:
systemctl status gestures
  Reply
#9
systemctl status gestures
● gestures.service - gestures
Loaded: loaded (/etc/systemd/system/gestures.service; enabled; vendor preset:
enabled)
Active: inactive (dead) since Wed 2020-01-22 20:24:11 CST; 16min ago
Main PID: 360 (code=exited, status=0/SUCCESS)

Jan 22 20:24:11 Debian-Desktop systemd[1]: Started gestures.
Jan 22 20:24:11 Debian-Desktop dex[360]: File does not exist: /home/rock/.config
/autostart/libinput-gestures.desktop
  Reply
#10
(01-22-2020, 08:42 PM)appdev46 Wrote: systemctl status gestures
● gestures.service - gestures
  Loaded: loaded (/etc/systemd/system/gestures.service; enabled; vendor preset:
enabled)
  Active: inactive (dead) since Wed 2020-01-22 20:24:11 CST; 16min ago
Main PID: 360 (code=exited, status=0/SUCCESS)

Jan 22 20:24:11 Debian-Desktop systemd[1]: Started gestures.
Jan 22 20:24:11 Debian-Desktop dex[360]: File does not exist: /home/rock/.config
/autostart/libinput-gestures.desktop

Well there is your problem, dex cannot find your .desktop file. is your user name different from the default 'rock' user?
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Instructions for Installing VS Code on Manjaro clover 3 531 12-20-2019, 10:18 PM
Last Post: tophneal

Forum Jump:


Users browsing this thread: 1 Guest(s)