Skip to content

Instantly share code, notes, and snippets.

@adeutscher
adeutscher / README.md
Last active September 22, 2019 08:58
Conky Timer: Proof of Concept
#!/usr/bin/env python
'''
Output desktop notifications when useful hotplug events happen.
'''
from __future__ import print_function # Python3 printing in Python2
import pyudev # For detecting events
# Basic includes
import getopt, os, sys
@adeutscher
adeutscher / hotplug-testing.py
Last active July 11, 2021 18:49
Exploration of using pyudev for hotplug events.
#!/usr/bin/env python
'''
A bit of exploration kicked off by this example: https://avilpage.com/2016/09/detecting-device-events-in-ubuntu-with-python.html
Useful documentation links:
* https://pyudev.readthedocs.io/en/v0.12/api/device.html
* https://pyudev.readthedocs.io/en/v0.13/api/monitor.html
* https://pyudev.readthedocs.io/en/latest/guide.html
Other: