Skip to main content

udev-cli

Print udev events, filter udev events, and run commands on udev events. udev is a system of events when hardware devices are plugged into a computer on linux.

This is unreviewed AI-generated code. But will become more reviewed if people use it.

Motivation

I have a tried to use udev a few times. But I always find it difficult to actually get my events to fire and debug what is going on. I've decied to just listen to events myself and trigger events rather than mess ith rules.

Alternatives and prior work

udev-monitor is a pypi project which is very similar. However, it could not filter by UUID, so I decided to vibe code something up.

udev itself has a rule system and

udevadm monitor can output events from udev put does not output JSON. I am also concerned about buffering.

This uses pyudev internally. You could achieve this functionality with a little python script using pyudev and do other things - but it would involve a little more debugging to understand what is going on.

Installation

pipx install udev-cli

Usage

Print all udev events: udev-cli. You can use jq to help you work out what you want to match.

block device events only: udev-cli -s block

block devices added: udev-cli -s block -a add

match specific UUID: udev-cli -f ID_FS_UUID b9335c96-...

match any UUID in file: udev-cli -f ID_FS_UUID @/etc/backup-uuids.txt

run a command: udev-cli -s block -a add -f ID_FS_UUID @uuids --run ./backup.sh

About

I am @readwithai. I am making tools for reading and agency with and without AI. I also make a lot of small tools related to productivity. If this tool is useful you might like follow me on github or X.

Metadata

Release files for udev-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for udev-cli 0.1.0
File Size Uploaded Provenance Actions
udev_cli-0.1.0.tar.gz 3.8 kB Without provenance Details for udev_cli-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for udev-cli 0.1.0
File Interpreter ABI Platform Actions
udev_cli-0.1.0-py3-none-any.whl Python 3 none any Details for udev_cli-0.1.0-py3-none-any.whl

Total release size: 7.9 kB

Release files / udev_cli-0.1.0.tar.gz

Download URL udev_cli-0.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5ffa0bc26ae4793e86ec1e9df05f1fe0c036a9215fa309908537d3f6aa38597b
BLAKE2b-256 checksum
How to use checksums
bd018abcffb381eb6781d97de4e8256f37ebdca59b0b15c3e67a23b6be0e506c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / udev_cli-0.1.0-py3-none-any.whl

Download URL udev_cli-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5de88b0075f9ba25ea970a89547ac27a96813c9f96b7d009fd6a145c31a37bd
BLAKE2b-256 checksum
How to use checksums
b17aa19ae4a6d0b097c560c21118924ceaa996e7b9755be581119d25701acf54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for udev-cli 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page