GitHunt
TA

talwrii/udev-cli

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.

Languages

Python78.6%Shell21.4%

Contributors

Created March 2, 2026
Updated March 2, 2026
talwrii/udev-cli | GitHunt