Giter VIP home page Giter VIP logo

triggerhappy's Introduction

Triggerhappy
- a lightweight hotkey daemon -

by Stefan Tomanek <[email protected]>
http://github.com/wertarbyte/triggerhappy/

Triggerhappy is a hotkey daemon developed with small and embedded systems in
mind, e.g. linux based routers. It attaches to the input device files and
interprets the event data received and executes scripts configured in its
configuration.

Examples:

Dump all events received through two device files:

	thd --dump /dev/input/event0 /dev/input/event1

Event handlers can be defined in configuration files (specified by --triggers).
If a directory is specified, all configuration files within matching the
pattern *.conf are loaded. The files use the following format:

<event name>	<event value>	<command line>

e.g.

KEY_VOLUMEUP	1		/usr/bin/amixer set Master 5%+
KEY_VOLUMEUP	2		/usr/bin/amixer set Master 5%+
KEY_VOLUMEDOWN	1		/usr/bin/amixer set Master 5%-
KEY_VOLUMEDOWN	2		/usr/bin/amixer set Master 5%-

A value of 1 corresponds to pressing a key, while 2 is generated by
holding it; releasing it yields a value of 0.

It is also possible to append up to 5 modifiers to each event definition by
appending their names to the event name:

KEY_VOLUMEUP+KEY_LEFTSHIFT	1	/usr/bin/amixer set Master 15%+

Devices can be added dynamically by specifying a command socket:

thd --socket /var/run/triggerhappy.socket --triggers /etc/triggerhappy.d/

The program th-cmd is used to add new devices to the daemon:

th-cmd --socket /var/run/triggerhappy.socket --add /dev/input/event0
th-cmd --socket /var/run/triggerhappy.socket --remove /dev/input/event3

An example udev script is also included to facilitate this hotplug
support - for this use, th-cmd can handle the parameter "udev" to
deduce the device name and action from the udev environment.

For more information, consult the manual pages of "thd" and "th-cmd".

triggerhappy's People

Contributors

wertarbyte avatar dreiss avatar jmuchemb avatar jacmet avatar ago avatar andrewshadura avatar code7r avatar

Watchers

James Cloos avatar Julien Grossholtz 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.