Debian Codegraph @

examples/cd-find-device-by-property.py

raw
1 #!/usr/bin/python
2
3 # Copyright (C) 2011-2012 Richard Hughes <[email protected]>
4 # Licensed under the GNU General Public License Version 2
5
6 from gi.repository import Colord
7 from gi.repository import Gio
8
9 # connect to colord
10 cancellable = Gio.Cancellable.new();
11 client = Colord.Client.new()
12 client.connect_sync(cancellable)
13
14 # find the device with the correct parameters
15 device = client.find_device_by_property_sync("XRANDR_name", "LVDS1", cancellable)
16 device.connect_sync(cancellable)
17
18 # get the default profile for the device
19 profile = device.get_default_profile()
20 profile.connect_sync(cancellable)
21
22 print "default profile filename", profile.get_filename()