본문 바로가기

개발

Ubunutu 에서 touchpad 제스쳐 사용하기

728x90

 

우분투나 여러 Linux 배포판을 사용하면서 아쉬운 것은 Mac에서 Touch Pad 를 이용하여 Swipe 로 다른 작업 공간으로 이동하거나, 작업 공간 전체를 보여준다거나 하는 Gesture 를 사용 할 수 없다는 것이었다.

이런 고민을 하던 중 우분투에서 제스처를 사용할 수 있는 방법을 찾았다. libinput-gestures, fusuma 라는 것을 이용하는 것이다.

두 방법 중에서 fusuma 가 배터리 소모가 적어 개인적으로는 fusuma 를 사용을 추천한다.

 

# libinput-gestures 사용

github.com/bulletmark/libinput-gestures

 

bulletmark/libinput-gestures

Actions gestures on your touchpad using libinput. Contribute to bulletmark/libinput-gestures development by creating an account on GitHub.

github.com

1. input 그룹에 현재 계정을 추가한다.

sudo gpasswd -a $USER input


2. python3 와 추가 라이브러리를 설치한다.

sudo apt-get install python3 xdotool wmctrl

 

3. libinput-tools 를 설치한다.

sudo apt-get install libinput-tools


4. git 에서 libinput-gesture 를 설치한다.

git clone https://github.com/bulletmark/libinput-gestures.git
cd libinput-gestures
sudo make install (or sudo ./libinput-gestures-setup install)
libinput-gestures-setup autostart


5. libinput-gesture config 를 설정한다.

cp /etc/libinput-gestures.conf ~/.config/libinput-gestures.conf
vi ~/.config/libinput-gestures.conf

 

[ libinput-gesture.conf ]

gesture swipe up    4    xdotool key ctrl+alt+Up
gesture swipe down  4    xdotool key ctrl+alt+Down
gesture swipe left  4    xdotool key ctrl+alt+Left
gesture swipe right 4    xdotool key ctrl+alt+Right# Spreads all windows in all workspaces + Show/Hide desktop
gesture swipe up    3    xdotool key shift+super+w
gesture swipe down  3    xdotool key super+d# Page back and forward on most Web Browsers
gesture swipe left  3    xdotool key alt+Left
gesture swipe right 3    xdotool key alt+Right# Maximize + Unmaximize/Minimize gestures
gesture pinch out   xdotool key ctrl+shift+21
gesture pinch in  xdotool key ctrl+20

 


6. 재부팅 하여 libinput-gesture 가 동작하는지 확인 한다.

 

 

# fusuma 사용

github.com/iberianpig/fusuma

 

iberianpig/fusuma

Multitouch gestures with libinput driver on Linux. Contribute to iberianpig/fusuma development by creating an account on GitHub.

github.com

 

1. input 그룹에 현재 계정을 추가한다.

sudo gpasswd -a $USER input

 

2. libinput-tools 를 설치한다.

sudo apt-get install libinput-tools

 

3. Fusama 설치

sudo apt-get install ruby
sudo gem install fusuma

 

4. touch pad 가 동작하지 않는 경우 아래와 같이 명령어를 실행한다.

gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled

 

5. gesture 를 설정한다.

mkdir -p ~/.config/fusuma
vi ~/.config/fusuma/config.yml

 

[config.yml]

gesture swipe up    4    xdotool key ctrl+alt+Up
gesture swipe down  4    xdotool key ctrl+alt+Down
gesture swipe left  4    xdotool key ctrl+alt+Left
gesture swipe right 4    xdotool key ctrl+alt+Right# Spreads all windows in all workspaces + Show/Hide desktop
gesture swipe up    3    xdotool key shift+super+w
gesture swipe down  3    xdotool key super+d# Page back and forward on most Web Browsers
gesture swipe left  3    xdotool key alt+Left
gesture swipe right 3    xdotool key alt+Right# Maximize + Unmaximize/Minimize gestures
gesture pinch out   xdotool key ctrl+shift+21
gesture pinch in  xdotool key ctrl+20