Skip to content

Instantly share code, notes, and snippets.

@darkxst
Created May 27, 2012 02:13
Show Gist options
  • Save darkxst/2795960 to your computer and use it in GitHub Desktop.
Save darkxst/2795960 to your computer and use it in GitHub Desktop.
network manager test
const nc = imports.gi.NMClient
const NetworkManager = imports.gi.NetworkManager
ncc = nc.Client.new()
ifs = [];
iface_list = ncc.get_devices()
for(let j = 0; j < iface_list.length; j++){
print(iface_list[j].state)
print(iface_list[j].get_iface())
print(iface_list[j].get_ip_iface())
if (iface_list[j].state == NetworkManager.DeviceState.ACTIVATED){
print("Activated")
ifs.push(iface_list[j].get_ip_iface())
}
}
print(NetworkManager.DeviceState.ACTIVATED)
print(iface_list.length)
print(ifs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment