Skip to content

MiloLug/linux-event-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux-event-listener

Compilation Requirements

make clang linux-headers

Compilation

# run:
sudo make install

Help

Usage: event-listener <event-source> <type> <code> <value> <command> [skip-count]
Example: event-listener /dev/input/event0 4 4 85 "shutdown -P now"

Parameters:
    <event-source> - string; event-source path
    <type>         - int; '*' = any
    <code>         - int; '*' = any
    <value>        - int; '*' = any
    <command>      - string; will be executed on match
    [skip-count]   - int; 0 by default; how many times to skip the event
        example: when it occurs two times and you want it to happen only once, just set skip-count to 1

The command's env variables:
    E_TIME_SEC     - int; timestamp's seconds
    E_TIME_USEC    - int; timestamp's remaining microseconds
    E_TYPE         - int
    E_CODE         - int
    E_VALUE        - int

Releases

No releases published

Packages

No packages published