Commit 3c430920 authored by jo-so's avatar jo-so

network_watcher: Add support for systemd-networkd

The systemd-networkd uses another D-Bus interface and different messages
than Network Manager.
parent 77e19784
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
## Nikos Kouremenos <kourem AT gmail.com> ## Nikos Kouremenos <kourem AT gmail.com>
## Stefan Bethge <stefan AT lanpartei.de> ## Stefan Bethge <stefan AT lanpartei.de>
## Copyright (C) 2006-2017 Yann Leboulanger <asterix AT lagaule.org> ## Copyright (C) 2006-2017 Yann Leboulanger <asterix AT lagaule.org>
## Copyright (C) 2017 Jörg Sommer <joerg@alea.gnuu.de>
## ##
## This file is part of Gajim. ## This file is part of Gajim.
## ##
...@@ -82,3 +83,14 @@ if dbus_support.supported: ...@@ -82,3 +83,14 @@ if dbus_support.supported:
'/org/freedesktop/NetworkManager') '/org/freedesktop/NetworkManager')
except Exception: except Exception:
pass pass
elif 'org.freedesktop.network1' in bus.list_names():
"""
For systemd-networkd
"""
def state_changed(sender, data, junk):
if 'OperationalState' in data:
update_accounts(connection_is_up = data['OperationalState'] == 'routable')
bus.add_signal_receiver(state_changed, 'PropertiesChanged',
path = '/org/freedesktop/network1')
supported = True
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment