Skip to content

Instantly share code, notes, and snippets.

View kuzen's full-sized avatar
🏠
student

kuzen

🏠
student
View GitHub Profile
@sharun-s
sharun-s / dbusnetmon.py
Last active March 21, 2024 07:39
Catch Signals from NetworkManager on DBus when Network Connection/Device State changes (Tested on Ubuntu 18.04)
#For more info see-
#https://dbus.freedesktop.org/doc/dbus-python/tutorial.html#receiving-signals
#https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html
#https://dbus.freedesktop.org/doc/dbus-specification.html
import dbus
from gi.repository import GLib
from dbus.mainloop.glib import DBusGMainLoop
NMState={