From 72be1234e1ec030cb07095267e49481057eeb329 Mon Sep 17 00:00:00 2001 From: coasteen Date: Sun, 12 Jul 2026 08:16:17 +0330 Subject: init --- local/bin/yellusb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 local/bin/yellusb (limited to 'local/bin/yellusb') diff --git a/local/bin/yellusb b/local/bin/yellusb new file mode 100755 index 0000000..1f53ecd --- /dev/null +++ b/local/bin/yellusb @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import pyudev +import subprocess + +context = pyudev.Context() +monitor = pyudev.Monitor.from_netlink(context) +monitor.filter_by(subsystem='block') + +for device in iter(monitor.poll, None): + if device.action == 'add': + print(f"New device detected: {device.device_node}") + subprocess.run(f"notify-send 'New device connected: {device.device_node}'", shell=True) \ No newline at end of file -- cgit v1.2.3