@@ -0,0 +1,1242 @@
+#!/usr/bin/python%0A%0Aimport os, re, sys, subprocess%0A%0Adef read_event():%0A    line = p.stdout.readline()%0A    while not line or re.search('%5Ba-zA-Z%5D+', line): line = p.stdout.readline()%0A    tokens = %5B c for c in re.split('(%5B%5E0-9%5C.%5D)+', line.strip()) if c.strip() %5D%0A    return (int(tokens%5B1%5D), int(tokens%5B2%5D), int(tokens%5B4%5D))%0A%0Adef fingers_count(events):%0A    l = %5Bev%5B2%5D for ev in events%5D%0A    return max(set(l), key = l.count)%0A%0Acmd = 'synclient -m 20'%0Ap = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell = True)%0A%0Atry:%0A    x, y, n = read_event()%0A    while True:%0A        events = %5B%5D%0A        x, y, n = read_event()%0A        while n != 0: events.append(read_event())%0A        if len(events) == 0: continue%0A%0A        f = fingers_count(events)%0A        dx, dy = events%5B-1%5D%5B0%5D - events%5B0%5D%5B0%5D, events%5B-1%5D%5B1%5D - events%5B0%5D%5B1%5D%0A        if f == 3:%0A            if   dx %3E  150: os.system(%22xdotool key ctrl+alt+Left%22)%0A            elif dx %3C -150: os.system(%22xdotool key ctrl+alt+Right%22)%0A        if f == 4:%0A            if   dy %3E  150: os.system(%22xdotool key super+D%22)%0A            elif dy %3C -150: os.system(%22xdotool key super+W%22)%0A        if f == 5:%0A            if abs(dy) %3E 100: os.system(%22xdotool key alt+F4%22)%0Aexcept KeyboardInterrupt: pass%0A

Add tochpad-gestures.py