/usr/share/ofono/scripts/display-icon is in ofono-scripts 1.17.bzr6912+16.04.20160314.3-0ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/usr/bin/python3
import sys
import dbus
if (len(sys.argv) < 2):
print("Usage: %s [modem] icon_id" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
modems = manager.GetModems()
modem = modems[0][0]
if (len(sys.argv) == 2):
icon = sys.argv[1]
elif (len(sys.argv) == 3):
modem = sys.argv[1]
icon = sys.argv[2]
print("Using modem %s" % modem)
sim = dbus.Interface(bus.get_object('org.ofono', modem),
'org.ofono.SimManager')
icon = sim.GetIcon(dbus.Byte(int(icon)))
xpm = ""
for byte in icon:
xpm += str(byte)
f = open("/tmp/icon.xpm", 'w')
f.write(xpm)
f.close()
|