Skip to main content

Run shell commands on Linux input device events; grab the device so X stops seeing them

Project description

linux-event-triggers

Run certain triggers when a linux event file received an event. Prevent other processes from receiving the event.

AI-generated and unreviewed.

Alternatives and prior work

kbd can remap keys for keyboards. It also supports command to run commands. I already used kbd as a separate device and didn't want to mix up another device and activity in this.

triggerhappy basically does the same thing as this program. However, when running in non-daemon mode it does not seem able to grab the event (or so claude says) and I don't really want to mess around with daemons.

Installation

pipx install linux-event-triggers

Usage

Print when a is clicked, use sudo to own the device.

evtrig $DEVICE --chown --bind "a=echo hello"

Where $DEVICE is an event device. Note that you can use udevadm to find a fixed path for the event - indexed by the usb device name rather that event*.

--chown use sudo to take ownership of the event file. By using the fixed filename.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linux_event_triggers-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linux_event_triggers-1.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file linux_event_triggers-1.0.0.tar.gz.

File metadata

  • Download URL: linux_event_triggers-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for linux_event_triggers-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0f92b8e00e7082aff452861c4962f6664e677413a47a7520b07a3a525bbf30c7
MD5 13dffa98bb2d91dbda4a0ba16ba6911d
BLAKE2b-256 ad5e45c74daf073be3bae3b51a5a38ea3d7a8b83041d64e45967c8092e3e3b93

See more details on using hashes here.

File details

Details for the file linux_event_triggers-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for linux_event_triggers-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4f2df4e08e82a6fdf9f4f8c15e0868206c12ba4029b4e1b70c4855dd7185852
MD5 a14dff112cd338cb1fa878368458933b
BLAKE2b-256 ca4684b99e64e165642360071bb9dd7c60644a08dfd1514a6ced90da39dec489

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page