Giter Club home page Giter Club logo

evdev-trigger's Introduction

evdev-trigger

Build Status

  • run shell commands when evdev input focus changes.

I use this to auto-disable mousetweaks when I'm using my touchscreen monitor, and auto-enable mousetweaks when I switch to my touchpad. This prevents unnecessary auto-clicks when tapping my touchscreen monitor.

install globally and run

With node.js installed on the target X11 box:

$ npm install -g evdev-trigger            # might need to prefix with sudo
$ evdev-trigger

To read from /dev/input/ the running user needs to be a member of the input group.

configure

On its first run evdev-trigger copies the default configuration file to $XDG_CONFIG_HOME/evdev-trigger.conf which defaults to $HOME/.config/evdev-trigger.conf. Edit this leanconf file with one or more rules:

/dev/input/path:                # for example /dev/input/event0
  *:                            # event filter, wildcard * matches all events
    run: shell-command-to-run

The following example configuration file enables or disables mousetweaks depending on which input device is currently in use:

# evdev-trigger.conf example configuration

/dev/input/by-id/usb-PixArtImaging_OpticalTouchScreen_0000-event-if00:
  *:
    run: mousetweaks --shutdown

/dev/input/by-id/usb-Wacom_Co._Ltd._Intuos_PTS-if01-event-mouse:
  *:
    run: mousetweaks --dwell --daemonize

options

$ evdev-trigger --help
Usage: evdev-trigger [Options]

Options:

  -h, --help                output usage information
  -V, --version             output the version number
  -c, --config-path [path]  path to configuration file (default:~/.config/evdev-trigger.conf)
  -d, --dry-run             trace commands without executing
  -v, --verbose             emit detailed trace for debugging

developer build and run

$ git clone --branch=dev https://github.com/dizzib/evdev-trigger.git
$ cd evdev-trigger
$ npm install     # install dependencies
$ npm test        # build all and run tests
$ npm start       # start the task runner and dry-run evdev-trigger

license

MIT

evdev-trigger's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.