Git Product home page Git Product logo

mygestures's Introduction

MyGestures - mouse gestures for linux

Mouse gestures - "draw" commands using your mouse/touchscreen/touchpad. Now with multitouch gestures on synaptics touchpads (experimental).

Installing from source:

sudo apt install pkg-config autoconf libtool libx11-dev libxrender-dev libxtst-dev libxml2-dev git make
git clone https://github.com/deters/mygestures.git
cd mygestures/
sh autogen.sh
./configure
make
sudo make install

Generating a .deb package (optional)

After installing from source:

sudo apt install debhelper
dpkg-buildpackage # it'll probably complain about not being able to sign the package. thats fine.
ls ../mygestures*.deb

Usage:

mygestures                       # use default button (button 3) on default device (Virtual core pointer)
mygestures -l                    # list device names  
mygestures -d 'elan touchscreen' # mygestures running against an specific device
mygestures -m                    # experimental synaptics multitouch mode  *
                                 # * see next section

Optional: If you want multitouch gestures on your synaptics touchpad

Installing the custom synaptics driver:

sudo apt-get install -y git build-essential libevdev-dev autoconf automake libmtdev-dev xorg-dev xutils-dev libtool
sudo apt-get remove -y xserver-xorg-input-synaptics
git clone https://github.com/Chosko/xserver-xorg-input-synaptics.git
cd xserver-xorg-input-synaptics
./autogen.sh
./configure --exec_prefix=/usr
make
sudo make install

Enable the option SHMConfig:

sudo mkdir -p /etc/X11/xorg.conf.d/

cat > /etc/X11/xorg.conf.d/50-synaptics.conf < EOL
Section "InputClass"
Identifier "evdev touchpad catchall"
Driver "synaptics"
MatchDevicePath "/dev/input/event*"
MatchIsTouchpad "on"
Option "Protocol" "event"
Option "SHMConfig" "on"
EndSection
EOL

Reboot the computer and then test the new driver:

synclient -m 10

And then in mygestures:

mygestures -m

Gestures configuration:

In the first execution mygestures will create a configuration file for your user:

~/.config/mygestures/mygestures.xml

Mygestures works by capturing your mouse movements and define them in terms of basic directions:

           U - (Up)
           D - (Down)
           R - (Right)
           L - (Left)
           7 - (Top left corner)
           9 - (Top right corner)
           1 - (Bottom left corner)
           3 - (Bottom right corner)

A "movement" can be defined by composing this directions under a name.

<movement name="T" value="RLD" />      <!-- T is a sequence of right+left+down -->
<movement name="V" value="39" />       <!-- V needs more precision to be defined.-->
<movement name="C" value="U?LDRU?" />  <!-- C (notice the use of regex) -->

Then you should define some contexts (used to filter applications):

<context name="Terminal windows" windowclass=".*(Term|term).*" windowtitle=".*">
   <!-- some gestures here -->
</context>

<context name="All applications" windowclass=".*" windowtitle=".*">
   <!-- some gestures here -->
</context>

Inside each context you can define the gestures:

<gesture name="Run gedit" movement="G">
  <do action="exec" value="gedit" />
</gesture>

<gesture name="Copy (Ctrl+C)" movement="C">
  <do action="keypress" value="Control_L+C" />
</gesture>

Example of actions can be:

Window management

<do action="maximize" /> <!-- put focused window to the maximized state -->
<do action="restore" /> <!-- restore window from maximized state -->
<do action="iconify" /> <!-- iconify window -->
<do action="toggle-maximized" /> <!-- toggle focused window from/to the maximized state -->
<do action="raise" /> <!-- raise current window -->
<do action="lower" /> <!-- lower current window -->

Program operation

<do action="kill" /> <!-- kill the current application -->
<do action="exec" value="gedit" /> <!-- launch some program -->

KeyPress

<do action="keypress" value="Alt_L+Left" /> <!-- send key sequence -->

More key names can be found on the file /usr/include/X11/keysymdef.h

mygestures's People

Contributors

deters avatar noscript avatar

Stargazers

 avatar  avatar Doãn Hiện avatar  avatar  avatar  avatar  avatar Gaurav Kumar avatar 董咚懂咚 avatar Michael (misc147) avatar Oz Tiram avatar Chao Zheng avatar  avatar bilabila avatar  avatar Ivan avatar Seninha avatar Ajwad Shaikh avatar  avatar Klaus Ferreira avatar Justin Tirrell avatar Prashant Shakya avatar ljx avatar Christoph Feck avatar  avatar  avatar  avatar

Watchers

 avatar  avatar James Cloos avatar Kenn avatar  avatar

mygestures's Issues

Mod4 + button3 to resize window

Mod4 + button3 is commonly used to resize floating window, which stops working when mygestures is up. Can mygestures pass through or ignore modifier + button events?

Double click only action?

Is it possible to create an action when I double right click my mouse?

This isn't strictly a mouse "gesture"

I've tried easystrokes and it doesn't seem to support this.

Drag & drop support (e.g. to interactively move a window)

I wonder if there is any drag & drop support for window management. Ideally in conjunction with keyboard (e.g. I need to press & hold Shift on a keyboard and then I can use LMB to start drag & drop while in the mean time I can release Shift and then finish the drag & drop action).

Do you think this would be possible?

Thanks!

Build/install problems (autogen?)

Long-time user here, unfortunately the latest version doesn't build. Autogen appears to complete successfully on Mint 17.2:

`Preparing the MyGestures build system...please wait

Found GNU Autoconf version 2.69
Found GNU Automake version 1.14.1
Found GNU Libtool version 2.4.2

Automatically preparing build ... done

The MyGestures build system is now prepared. To build here, run:
./configure
make
`
Following instructions, next I run make:

make: *** No targets specified and no makefile found. Stop.

If I attempt ./configure first, it runs with no errors, then attempt make again:

Making all in src make[1]: Entering directory /home/gameboyrmh/mygestures/src'
make all-am
make[2]: Entering directory /home/gameboyrmh/mygestures/src' depbase=echo main.o | sed 's|[^/]$|.deps/&|;s|.o$||';\ gcc -DHAVE_CONFIG_H -I. -DSYSCONFDIR='"/usr/local/etc"' -O2 -I/usr/include/libxml2 -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=echo mygestures.o | sed 's|[^/]$|.deps/&amp;|;s|.o$||';\ gcc -DHAVE_CONFIG_H -I. -DSYSCONFDIR='"/usr/local/etc"' -O2 -I/usr/include/libxml2 -g -O2 -MT mygestures.o -MD -MP -MF $depbase.Tpo -c -o mygestures.o mygestures.c &&\ mv -f $depbase.Tpo $depbase.Po mygestures.c: In function 'mygestures_run': mygestures.c:152:3: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < self->device_count; ++i) { ^ mygestures.c:152:3: note: use option -std=c99 or -std=gnu99 to compile your code make[2]: *** [mygestures.o] Error 1 make[2]: Leaving directory /home/gameboyrmh/mygestures/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory /home/gameboyrmh/mygestures/src' make: *** [all-recursive] Error 1

Super key

Hi, how do i write point out the "Super" key? Super string not works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.