mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 04:48:00 +01:00
trying to fix
This commit is contained in:
24
autoconnect.py
Normal file
24
autoconnect.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import gobject
|
||||
import dbus
|
||||
import dbus.service
|
||||
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
|
||||
import dbus.glib
|
||||
|
||||
#############
|
||||
#declare our connections to our daemon.
|
||||
#without them nothing useful will happen
|
||||
#the daemon should be running as root
|
||||
bus = dbus.SystemBus()
|
||||
proxy_obj = bus.get_object('org.wicd.daemon', '/org/wicd/daemon')
|
||||
##we don't need some of these, so I just comment them out
|
||||
daemon = dbus.Interface(proxy_obj, 'org.wicd.daemon')
|
||||
wireless = dbus.Interface(proxy_obj, 'org.wicd.daemon.wireless')
|
||||
wired = dbus.Interface(proxy_obj, 'org.wicd.daemon.wired')
|
||||
#config = dbus.Interface(proxy_obj, 'org.wicd.daemon.config')
|
||||
#############
|
||||
|
||||
print daemon.Hello()
|
||||
if wireless.CheckIfWirelessConnecting() == False and wired.CheckIfWiredConnecting() == False:
|
||||
print wireless.AutoConnect(True)
|
||||
Reference in New Issue
Block a user