File: example.py

package info (click to toggle)
gtherm 0.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 340 kB
  • sloc: ansic: 1,252; xml: 144; python: 13; makefile: 9
file content (20 lines) | stat: -rwxr-xr-x 518 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python3
#
# export GI_TYPELIB_PATH=/usr/local/lib/x86_64-linux-gnu/girepository-1.0/

import gi
gi.require_version('Gio', '2.0')
from gi.repository import Gio
gi.require_version('GTherm', '0.0')
from gi.repository import GTherm

con = Gio.bus_get_sync(Gio.BusType.SESSION, None)
manager = GTherm.Manager.new_sync(con, 0, None)

print("Cooling devices")
for d in manager.get_cooling_devices():
    print("{}".format(d))

print("Thermal zones")
for d in manager.get_thermal_zones():
    print("{}".format(d))