summaryrefslogtreecommitdiff
path: root/index.html
blob: 0f9af769a10c61e67328df93eafcaf47fb76acac (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
<!DOCTYPE html>
<html>

  <head>
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="description" content="Consolekit2 : ConsoleKit2 is a framework for defining and tracking users, login sessions, and seats.">

    <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">

    <title>Consolekit2</title>
  </head>

  <body>

    <!-- HEADER -->
    <div id="header_wrap" class="outer">
        <header class="inner">
          <a id="forkme_banner" href="https://github.com/ConsoleKit2/ConsoleKit2">View on GitHub</a>

          <h1 id="project_title">Consolekit2</h1>
          <h2 id="project_tagline">ConsoleKit2 is a framework for defining and tracking users, login sessions, and seats.</h2>

            <section id="downloads">
              <a class="zip_download_link" href="https://github.com/ConsoleKit2/ConsoleKit2/zipball/master">Download this project as a .zip file</a>
              <a class="tar_download_link" href="https://github.com/ConsoleKit2/ConsoleKit2/tarball/master">Download this project as a tar.gz file</a>
            </section>
        </header>
    </div>

    <!-- MAIN CONTENT -->
    <div id="main_content_wrap" class="outer">
      <section id="main_content" class="inner">
        <h1>
<a name="consolekit2-090-documentation" class="anchor" href="#consolekit2-090-documentation"><span class="octicon octicon-link"></span></a>ConsoleKit2 0.9.0 Documentation</h1>

<p><a href="https://scan.coverity.com/projects/3199"><img src="https://scan.coverity.com/projects/3199/badge.svg" alt="Coverity Scan Build Status"></a></p>

<p><a href="https://www.transifex.com/projects/p/consolekit2/">Help translate ConsoleKit2</a></p>

<h2>
<a name="about" class="anchor" href="#about"><span class="octicon octicon-link"></span></a>About</h2>

<p>ConsoleKit2 is a framework for keeping track of the various users, sessions,
and seats present on a system. It provides a mechanism for software to react
to changes of any of these items or of any of the metadata associated with
them. ConsoleKit2 also allows fast switching between open sessions on the
computer.</p>

<p>ConsoleKit2 is a fork of ConsoleKit since it is no longer maintained.
Information on ConsoleKit can be found at:
<a href="http://freedesktop.org/wiki/Software/ConsoleKit/">http://freedesktop.org/wiki/Software/ConsoleKit/</a> William Jon McCann was the
primary maintainer of ConsoleKit and most of this documentation was written by
him for ConsoleKit. It has been adapted for ConsoleKit2.</p>

<h2>
<a name="defining-the-problem" class="anchor" href="#defining-the-problem"><span class="octicon octicon-link"></span></a>Defining the Problem</h2>

<p>A simple example is two users logging into a computer at the same time. They
may be sharing the same set of hardware for their graphical session, such as
the monitor, keyboard, and mouse. ConsoleKit2 will keep track of those
resouces and which session is active and should have use of that hardware at a
given time.</p>

<h2>
<a name="relevant-art" class="anchor" href="#relevant-art"><span class="octicon octicon-link"></span></a>Relevant art</h2>

<p>Logind is a Linux daemon providing the similar functionality to ConsoleKit2.</p>

<h2>
<a name="chapter2terminology" class="anchor" href="#chapter2terminology"><span class="octicon octicon-link"></span></a>Chapter 2. Terminology</h2>

<h2>
<a name="session" class="anchor" href="#session"><span class="octicon octicon-link"></span></a>Session</h2>

<p>A session is a collection of all processes that share knowledge of a secret.
In the typical (or ideal) case, these processes all originate from a single
common ancestor.</p>

<p>As an implementation detail, for now, this secret should be stored in the
process environment by the session leader under the name XDG_SESSION_COOKIE.
When and if we are able to take advantage of a mechanism in the underlying
system to store session registration information - we will. However, such a
mechanism is not known at the present time.</p>

<p>Using an environment variable does have certain advantages. For one, it is
quite easy for a process to opt-out of a Session by simply unsetting the
XDG_SESSION_COOKIE variable.</p>

<p>Limitations of using an environment variable implementation include not being
able to strictly limit visibility of the secret to a particular process
ancestry. So, it is not possible to enforce session boundaries other than on a
per-user basis. For example, we don't yet have a way to prevent a process from
moving between sessions owned by the same user.</p>

<h2>
<a name="session-leader" class="anchor" href="#session-leader"><span class="octicon octicon-link"></span></a>Session leader</h2>

<p>The session leader is the process that requests that a new session be opened.
It does this by connecting to the D-Bus system bus and using either
org.freedesktop.ConsoleKit.Manager.OpenSession() or
org.freedesktop.ConsoleKit.Manager.OpenSessionWithParameters(). The session
that it registers will remain open until the connection to the system bus is
lost or it calls org.freedesktop.ConsoleKit.Manager.CloseSession().</p>

<p>The session leader is the only process for which CloseSession() will be
allowed.</p>

<h2>
<a name="seat" class="anchor" href="#seat"><span class="octicon octicon-link"></span></a>Seat</h2>

<p>A seat is a collection of sessions and a set of hardware (usually at least a
keyboard and mouse). Only one session may be active on a seat at a time.</p>

<p>At the present time, all Sessions that are considered "local" to a system will
be added the the first Seat and every other Session will be added to its own
Seat.</p>

<p>True, hardware, multi-seat capabilities will be added in a later release.</p>

<h2>
<a name="chapter3design" class="anchor" href="#chapter3design"><span class="octicon octicon-link"></span></a>Chapter 3. Design</h2>

<h2>
<a name="session-lifecycle" class="anchor" href="#session-lifecycle"><span class="octicon octicon-link"></span></a>Session Lifecycle</h2>

<p>The session leader process is responsible for asking ConsoleKit2 to open a new
session. In this respect, it is similar to the traditional POSIX user login
accounting framework. In the typical case, the session leader is either an
immediate descendant of a login manager or the login manager itself. The
leader makes a connection to the D-Bus system bus and asks ConsoleKit2 to open
a session. There are two methods available for opening a session:
org.freedesktop.ConsoleKit.Manager.OpenSession() and
org.freedesktop.ConsoleKit.Manager.OpenSessionWithParameters().</p>

<p>If the operation succeeds, a secret cookie will be returned to the session
leader. The session leader should store this secret in the environment as
XDG_SESSION_COOKIE so that it may be shared with its child processes.</p>

<p>At this point the session will be registered with ConsoleKit2 and a particular
set of information about the session will be stored along with it.</p>

<p>ConsoleKit2 will decide, based on the information associated with the session,
what Seat the session will be added to.</p>

<p>It will also be determined, based on the same set of information, whether the
Session will control the hardware associated with the Seat. In other words,
whether the Session will be active for the Seat it is attached to. The exact
mechanism for this determination depends on the type of Seat and the
capabilities of the host system.</p>

<p>The Session will remain open until the Session Leader disconnects from the
D-Bus system bus or calls org.freedesktop.ConsoleKit.Manager.CloseSession().
The session will be removed from its Seat, and deregistered.</p>

<h2>
<a name="expected-usage" class="anchor" href="#expected-usage"><span class="octicon octicon-link"></span></a>Expected Usage</h2>

<p>Use of this service will usually follow one of the following patterns:</p>

<h3>
<a name="text-login-manager" class="anchor" href="#text-login-manager"><span class="octicon octicon-link"></span></a>Text Login Manager</h3>

<p>This pattern operates as the Session Leader for a new Session. This pattern
needs:</p>

<ol>
<li>To open a new Session.</li>
<li>To set properties for the Session.</li>
<li>To maintain a connection to the D-Bus system bus.</li>
<li>To close the Session at logout.</li>
</ol>

<h3>
<a name="graphical-login-manager" class="anchor" href="#graphical-login-manager"><span class="octicon octicon-link"></span></a>Graphical Login Manager</h3>

<p>In addition to the requirements for the Text Graphical Login Manager, this
pattern is typically used to show information about currently open sessions.
It needs:</p>

<ol>
<li>To determine which Seat it is running on.</li>
<li>To know if the current seat supports session switching.</li>
<li>A list of all sessions on the current Seat.</li>
<li>To know which session is active for the current Seat.</li>
<li>To know when the session active state changes.</li>
<li>To know when sessions are added or removed.</li>
<li>Access to the metadata for any open Session.</li>
</ol>

<h3>
<a name="system-daemon" class="anchor" href="#system-daemon"><span class="octicon octicon-link"></span></a>System Daemon</h3>

<p>This is generally a daemon process running outside of a user session as a
special user. This pattern needs:</p>

<ol>
<li>To know if any user sessions are open.</li>
<li>To know if the system is currently being used.</li>
</ol>

<h3>
<a name="hardware-abstraction-layer" class="anchor" href="#hardware-abstraction-layer"><span class="octicon octicon-link"></span></a>Hardware Abstraction Layer</h3>

<p>This is a special case of System Daemon that provides catalogs and control
mechanisms for hardware devices. In addition to the requirements of System
Daemon, this pattern needs:</p>

<ol>
<li>To determine what hardware is associated with a Seat.</li>
<li>To determine what Session is active and inactive on a particular Seat.</li>
<li>To know when the session active state changes.</li>
<li>To determine what Session a process belongs to.</li>
</ol>

<h3>
<a name="fast-user-switching-agent" class="anchor" href="#fast-user-switching-agent"><span class="octicon octicon-link"></span></a>Fast User Switching Agent</h3>

<p>This is related to the Graphical Login Manager and provides a shortcut to
similar functionality. It is usually a tool available in the user session that
allows one to quickly switch to another user session. This pattern needs:</p>

<ol>
<li>To determine which session it is running in.</li>
<li>To determine which Seat it is running on.</li>
<li>To know if the current seat supports session switching.</li>
<li>A list of all sessions on the current Seat.</li>
<li>Which session is active for the current Seat.</li>
<li>To know when the session active state changes.</li>
<li>Access to the metadata for any open Session.</li>
<li>To know when sessions are added or removed.</li>
</ol>

<h3>
<a name="session-daemon-aka-policy-agent" class="anchor" href="#session-daemon-aka-policy-agent"><span class="octicon octicon-link"></span></a>Session Daemon (aka Policy Agent)</h3>

<p>This is typically a daemon running in a user session that acts on policy only
when the session is active. This pattern needs:</p>

<ol>
<li>To determine which session it is running in.</li>
<li>To know when the session active state changes.</li>
</ol>

<h3>
<a name="session-application" class="anchor" href="#session-application"><span class="octicon octicon-link"></span></a>Session Application</h3>

<p>This is typically an application running in a user session that may alter its
behavior when the session active state changes. This pattern needs:</p>

<ol>
<li>To determine which session it is running in.</li>
<li>To know when the session active state changes.</li>
</ol>

<h1>
<a name="partiireference" class="anchor" href="#partiireference"><span class="octicon octicon-link"></span></a>Part II. Reference</h1>

<h1>
<a name="d-bus-api-reference" class="anchor" href="#d-bus-api-reference"><span class="octicon octicon-link"></span></a>D-Bus API Reference</h1>

<hr>

<p>ConsoleKit2 provides a D-Bus API for programs to obtain information about the
users, sessions, and seats that are present on a system.</p>

<p>Please see the other sections of this manual for an introduction to these
concepts.</p>

<p>This API is not yet stable and is likely to change in the future.</p>

<p><strong>Table of Contents</strong></p>

<p>org.freedesktop.ConsoleKit.Manager — Manager interface</p>

<p>org.freedesktop.ConsoleKit.Seat — Seat interface</p>

<p>org.freedesktop.ConsoleKit.Session — Session interface</p>

<h2>
<a name="name" class="anchor" href="#name"><span class="octicon octicon-link"></span></a>Name</h2>

<p>org.freedesktop.ConsoleKit.Manager — Manager interface</p>

<h2>
<a name="methods" class="anchor" href="#methods"><span class="octicon octicon-link"></span></a>Methods</h2>

<pre><code>Restart()
CanRestart(out'b'can_restart)
Stop()
CanStop(out'b'can_stop)
OpenSession(out's'cookie)
OpenSessionWithParameters(in'a(sv)'parameters,
out's'cookie)
CloseSession(in's'cookie,
out'b'result)
GetSeats(out'ao'seats)
GetSessions(out'ao'sessions)
GetSessionForCookie(in's'cookie,
out'o'ssid)
GetSessionForUnixProcess(in'u'pid,
out'o'ssid)
GetCurrentSession(out'o'ssid)
GetSessionsForUnixUser(in'u'uid,
out'ao'sessions)
GetSessionsForUser(in'u'uid,
out'ao'sessions)
GetSystemIdleHint(out'b'idle_hint)
GetSystemIdleSinceHint(out's'iso8601_datetime)
</code></pre>

<h2>
<a name="signals" class="anchor" href="#signals"><span class="octicon octicon-link"></span></a>Signals</h2>

<pre><code>SeatAdded('o'sid)
SeatRemoved('o'sid)
SystemIdleHintChanged('b'hint)
</code></pre>

<h2>
<a name="implemented-interfaces" class="anchor" href="#implemented-interfaces"><span class="octicon octicon-link"></span></a>Implemented Interfaces</h2>

<p>Objects implementing org.freedesktop.ConsoleKit.Manager also implements
org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties</p>

<h2>
<a name="description" class="anchor" href="#description"><span class="octicon octicon-link"></span></a>Description</h2>

<h2>
<a name="details" class="anchor" href="#details"><span class="octicon octicon-link"></span></a>Details</h2>

<h3>
<a name="restart-" class="anchor" href="#restart-"><span class="octicon octicon-link"></span></a>Restart ()</h3>

<pre><code>Restart ()
</code></pre>

<p>This method initiates a request to restart (ie. reboot) the computer system.</p>

<h3>
<a name="canrestart-" class="anchor" href="#canrestart-"><span class="octicon octicon-link"></span></a>CanRestart ()</h3>

<pre><code>CanRestart (out'b'can_restart)
</code></pre>

<p><em><code>can_restart</code></em>:</p>

<h3>
<a name="stop-" class="anchor" href="#stop-"><span class="octicon octicon-link"></span></a>Stop ()</h3>

<pre><code>Stop ()
</code></pre>

<p>This method initiates a request to stop (ie. shutdown) the computer system.</p>

<h3>
<a name="canstop-" class="anchor" href="#canstop-"><span class="octicon octicon-link"></span></a>CanStop ()</h3>

<pre><code>CanStop (out'b'can_stop)
</code></pre>

<p><em><code>can_stop</code></em>:</p>

<h3>
<a name="opensession-" class="anchor" href="#opensession-"><span class="octicon octicon-link"></span></a>OpenSession ()</h3>

<pre><code>OpenSession (out's'cookie)
</code></pre>

<p>This method requests that a new Session be created for the calling process.
The properties of this new Session are set automatically from information
collected about the calling process.</p>

<p>This new session exists until the calling process disconnects from the system
bus or calls <code>CloseSession()</code>.</p>

<p>It is the responsibility of the calling process to set the environment
variable XDG_SESSION_COOKIE to the value of the returned cookie. This cookie
should only be made available to child processes of the caller so that they
may be identified as members of this session.</p>

<p>See this simple example:</p>

<pre><code>    DBusError       error;
    DBusMessage    *message;
    DBusMessage    *reply;

    message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit",
                        "/org/freedesktop/ConsoleKit/Manager",
                        "org.freedesktop.ConsoleKit.Manager",
                        "OpenSession");
    if (message == NULL) {
        goto out;
    }

        dbus_error_init (&amp;error);
        reply = dbus_connection_send_with_reply_and_block (connector-&gt;connection,
                                                           message,
                                                           -1,
                                                           &amp;error);
        if (reply == NULL) {
        goto out;
        }

        dbus_error_init (&amp;error);
        if (! dbus_message_get_args (reply,
                                     &amp;error,
                                     DBUS_TYPE_STRING, &amp;cookie,
                                     DBUS_TYPE_INVALID)) {
        goto out;
        }
</code></pre>

<p><em><code>cookie</code></em>:</p>

<pre><code>The secret cookie that is used to identify the new session
</code></pre>

<p>See also: <code>OpenSessionWithParameters()</code></p>

<h3>
<a name="opensessionwithparameters-" class="anchor" href="#opensessionwithparameters-"><span class="octicon octicon-link"></span></a>OpenSessionWithParameters ()</h3>

<pre><code>OpenSessionWithParameters (in'a(sv)'parameters,
out's'cookie)
</code></pre>

<p>This method requests that a new Session be created for the calling process.
The properties of this new Session are from the parameters provided.</p>

<p>This new session exists until the calling process disconnects from the system
bus or calls <code>CloseSession()</code>.</p>

<p>It is the responsibility of the calling process to set the environment
variable XDG_SESSION_COOKIE to the value of the returned cookie. This cookie
should only be made available to child processes of the caller so that they
may be identified as members of this session.</p>

<p>See the Session properties for a list of valid parameters.</p>

<p><em><code>parameters</code></em>:</p>

<pre><code>An array of sets of property names and values
</code></pre>

<p><em><code>cookie</code></em>:</p>

<pre><code>The secret cookie that is used to identify the new session
</code></pre>

<h3>
<a name="permissions" class="anchor" href="#permissions"><span class="octicon octicon-link"></span></a>Permissions</h3>

<p>This method is restricted to privileged users by D-Bus policy.</p>

<p>See also: org.freedesktop.ConsoleKit.Session</p>

<h3>
<a name="closesession-" class="anchor" href="#closesession-"><span class="octicon octicon-link"></span></a>CloseSession ()</h3>

<pre><code>CloseSession (in's'cookie,
out'b'result)
</code></pre>

<p>This method is used to close the session identified by the supplied cookie.</p>

<p>The session can only be closed by the same process that opened the session.</p>

<p><em><code>cookie</code></em>:</p>

<pre><code>The secret cookie that is used to identify the session
</code></pre>

<p><em><code>result</code></em>:</p>

<pre><code>Whether the session was successfully closed
</code></pre>

<h3>
<a name="getseats-" class="anchor" href="#getseats-"><span class="octicon octicon-link"></span></a>GetSeats ()</h3>

<pre><code>GetSeats (out'ao'seats)
</code></pre>

<p>This gets a list of all the Seats that are currently present on the system.</p>

<p>Each Seat ID is an D-Bus object path for the object that implements the Seat
interface.</p>

<p><em><code>seats</code></em>:</p>

<pre><code>an array of Seat IDs
</code></pre>

<p>See also: org.freedesktop.ConsoleKit.Seat</p>

<h3>
<a name="getsessions-" class="anchor" href="#getsessions-"><span class="octicon octicon-link"></span></a>GetSessions ()</h3>

<pre><code>GetSessions (out'ao'sessions)
</code></pre>

<p>This gets a list of all the Sessions that are currently present on the system.</p>

<p>Each Session ID is an D-Bus object path for the object that implements the
Session interface.</p>

<p><em><code>sessions</code></em>:</p>

<pre><code>an array of Session IDs
</code></pre>

<p>See also: org.freedesktop.ConsoleKit.Session</p>

<h3>
<a name="getsessionforcookie-" class="anchor" href="#getsessionforcookie-"><span class="octicon octicon-link"></span></a>GetSessionForCookie ()</h3>

<pre><code>GetSessionForCookie (in's'cookie,
out'o'ssid)
</code></pre>

<p>Returns the session ID that is associated with the specified cookie.</p>

<p><em><code>cookie</code></em>:</p>

<pre><code>The secret cookie that is used to identify the session
</code></pre>

<p><em><code>ssid</code></em>:</p>

<pre><code>The object identifier for the current session
</code></pre>

<h3>
<a name="getsessionforunixprocess-" class="anchor" href="#getsessionforunixprocess-"><span class="octicon octicon-link"></span></a>GetSessionForUnixProcess ()</h3>

<pre><code>GetSessionForUnixProcess (in'u'pid,
out'o'ssid)
</code></pre>

<p>Attempts to determine the session ID for the specified POSIX process ID (pid).</p>

<p><em><code>pid</code></em>:</p>

<pre><code>The POSIX process ID
</code></pre>

<p><em><code>ssid</code></em>:</p>

<pre><code>The object identifier for the current session
</code></pre>

<h3>
<a name="getcurrentsession-" class="anchor" href="#getcurrentsession-"><span class="octicon octicon-link"></span></a>GetCurrentSession ()</h3>

<pre><code>GetCurrentSession (out'o'ssid)
</code></pre>

<p>Attempts to determine the session ID that the caller belongs to.</p>

<p>See this example of using dbus-send:</p>

<pre><code>  dbus-send --system --dest=org.freedesktop.ConsoleKit \
  --type=method_call --print-reply --reply-timeout=2000 \
  /org/freedesktop/ConsoleKit/Manager \
  org.freedesktop.ConsoleKit.Manager.GetCurrentSession
</code></pre>

<p><em><code>ssid</code></em>:</p>

<pre><code>The object identifier for the current session
</code></pre>

<h3>
<a name="getsessionsforunixuser-" class="anchor" href="#getsessionsforunixuser-"><span class="octicon octicon-link"></span></a>GetSessionsForUnixUser ()</h3>

<pre><code>GetSessionsForUnixUser (in'u'uid,
out'ao'sessions)
</code></pre>

<p>This gets a list of all the Sessions that are currently open for the specified
user.</p>

<p>Each Session ID is an D-Bus object path for the object that implements the
Session interface.</p>

<p><em><code>uid</code></em>:</p>

<pre><code>POSIX User identification
</code></pre>

<p><em><code>sessions</code></em>:</p>

<pre><code>an array of Session IDs
</code></pre>

<h3>
<a name="getsessionsforuser-" class="anchor" href="#getsessionsforuser-"><span class="octicon octicon-link"></span></a>GetSessionsForUser ()</h3>

<pre><code>GetSessionsForUser (in'u'uid,
out'ao'sessions)
</code></pre>

<p>This gets a list of all the Sessions that are currently open for the specified
user.</p>

<p>Each Session ID is an D-Bus object path for the object that implements the
Session interface.</p>

<p><em><code>uid</code></em>:</p>

<pre><code>User identification
</code></pre>

<p><em><code>sessions</code></em>:</p>

<pre><code>an array of Session IDs
</code></pre>

<h3>
<a name="warning" class="anchor" href="#warning"><span class="octicon octicon-link"></span></a>Warning</h3>

<p><code>GetSessionsForUser</code> is deprecated since version 0.1.3 and should not be used
in newly-written code. Use <code>GetSessionsForUnixUser</code> instead.</p>

<h3>
<a name="getsystemidlehint-" class="anchor" href="#getsystemidlehint-"><span class="octicon octicon-link"></span></a>GetSystemIdleHint ()</h3>

<pre><code>GetSystemIdleHint (out'b'idle_hint)
</code></pre>

<p>Returns TRUE if the <code>idle-hint</code> property of every open session is TRUE or if
there are no open sessions.</p>

<p><em><code>idle_hint</code></em>:</p>

<pre><code>The value of the system-idle-hint
</code></pre>

<h3>
<a name="getsystemidlesincehint-" class="anchor" href="#getsystemidlesincehint-"><span class="octicon octicon-link"></span></a>GetSystemIdleSinceHint ()</h3>

<pre><code>GetSystemIdleSinceHint (out's'iso8601_datetime)
</code></pre>

<p>Returns an ISO 8601 date-time string that corresponds to the time of the last
change of the system-idle-hint.</p>

<p><em><code>iso8601_datetime</code></em>:</p>

<pre><code>An ISO 8601 format date-type string
</code></pre>

<h2>
<a name="signal-details" class="anchor" href="#signal-details"><span class="octicon octicon-link"></span></a>Signal Details</h2>

<h3>
<a name="the-seatadded-signal" class="anchor" href="#the-seatadded-signal"><span class="octicon octicon-link"></span></a>The SeatAdded signal</h3>

<pre><code>SeatAdded ('o'sid)
</code></pre>

<p>Emitted when a Seat has been added to the system.</p>

<p><em><code>sid</code></em>:</p>

<pre><code>The Seat ID for the added seat
</code></pre>

<h3>
<a name="the-seatremoved-signal" class="anchor" href="#the-seatremoved-signal"><span class="octicon octicon-link"></span></a>The SeatRemoved signal</h3>

<pre><code>SeatRemoved ('o'sid)
</code></pre>

<p>Emitted when a Seat has been removed from the system.</p>

<p><em><code>sid</code></em>:</p>

<pre><code>The Seat ID for the removed seat
</code></pre>

<h3>
<a name="the-systemidlehintchanged-signal" class="anchor" href="#the-systemidlehintchanged-signal"><span class="octicon octicon-link"></span></a>The SystemIdleHintChanged signal</h3>

<pre><code>SystemIdleHintChanged ('b'hint)
</code></pre>

<p>Emitted when the value of the system-idle-hint has changed.</p>

<p><em><code>hint</code></em>:</p>

<pre><code>The value of the system-idle-hint
</code></pre>

<hr>

<h2>
<a name="name-1" class="anchor" href="#name-1"><span class="octicon octicon-link"></span></a>Name</h2>

<p>org.freedesktop.ConsoleKit.Seat — Seat interface</p>

<h2>
<a name="methods-1" class="anchor" href="#methods-1"><span class="octicon octicon-link"></span></a>Methods</h2>

<pre><code>GetId(out'o'sid)
GetSessions(out'ao'sessions)
GetDevices(out'a(ss)'devices)
GetActiveSession(out'o'ssid)
CanActivateSessions(out'b'can_activate)
ActivateSession(in'o'ssid)
</code></pre>

<h2>
<a name="signals-1" class="anchor" href="#signals-1"><span class="octicon octicon-link"></span></a>Signals</h2>

<pre><code>ActiveSessionChanged('o'ssid)
SessionAdded('o'ssid)
SessionRemoved('o'ssid)
DeviceAdded('(ss)'device)
DeviceRemoved('(ss)'device)
</code></pre>

<h2>
<a name="implemented-interfaces-1" class="anchor" href="#implemented-interfaces-1"><span class="octicon octicon-link"></span></a>Implemented Interfaces</h2>

<p>Objects implementing org.freedesktop.ConsoleKit.Seat also implements
org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties</p>

<h2>
<a name="description-1" class="anchor" href="#description-1"><span class="octicon octicon-link"></span></a>Description</h2>

<p>A seat is a collection of sessions and a set of hardware (usually at least a
keyboard and mouse). Only one session may be active on a seat at a time.</p>

<h2>
<a name="details-1" class="anchor" href="#details-1"><span class="octicon octicon-link"></span></a>Details</h2>

<h3>
<a name="getid-" class="anchor" href="#getid-"><span class="octicon octicon-link"></span></a>GetId ()</h3>

<pre><code>GetId (out'o'sid)
</code></pre>

<p>Returns the ID for Seat.</p>

<p><em><code>sid</code></em>:</p>

<pre><code>Seat ID
</code></pre>

<h3>
<a name="getsessions--1" class="anchor" href="#getsessions--1"><span class="octicon octicon-link"></span></a>GetSessions ()</h3>

<pre><code>GetSessions (out'ao'sessions)
</code></pre>

<p>This gets a list of all the Sessions that are currently attached to this seat.</p>

<p>Each Session ID is an D-Bus object path for the object that implements the
Session interface.</p>

<p><em><code>sessions</code></em>:</p>

<pre><code>an array of Session IDs
</code></pre>

<h3>
<a name="getdevices-" class="anchor" href="#getdevices-"><span class="octicon octicon-link"></span></a>GetDevices ()</h3>

<pre><code>GetDevices (out'a(ss)'devices)
</code></pre>

<p>This gets a list of all the devices that are currently associated with this
seat.</p>

<p>Each device is an D-Bus structure that represents the device type and the
device id.</p>

<p><em><code>devices</code></em>:</p>

<pre><code>an array of devices
</code></pre>

<h3>
<a name="getactivesession-" class="anchor" href="#getactivesession-"><span class="octicon octicon-link"></span></a>GetActiveSession ()</h3>

<pre><code>GetActiveSession (out'o'ssid)
</code></pre>

<p>Gets the Session ID that is currently active on this Seat.</p>

<p>Returns NULL if there is no active session.</p>

<p><em><code>ssid</code></em>:</p>

<pre><code>Session ID
</code></pre>

<h3>
<a name="canactivatesessions-" class="anchor" href="#canactivatesessions-"><span class="octicon octicon-link"></span></a>CanActivateSessions ()</h3>

<pre><code>CanActivateSessions (out'b'can_activate)
</code></pre>

<p>Used to determine whether the seat supports session activation.</p>

<p><em><code>can_activate</code></em>:</p>

<pre><code>TRUE if seat supports session activation
</code></pre>

<h3>
<a name="activatesession-" class="anchor" href="#activatesession-"><span class="octicon octicon-link"></span></a>ActivateSession ()</h3>

<pre><code>ActivateSession (in'o'ssid)
</code></pre>

<p>Attempt to activate the specified session. In most cases, if successful, this
will cause the session to become visible and take control of the hardware that
is associated with this seat.</p>

<p><em><code>ssid</code></em>:</p>

<pre><code>Session ID
</code></pre>

<p>See also: <code>Activate()</code></p>

<h2>
<a name="signal-details-1" class="anchor" href="#signal-details-1"><span class="octicon octicon-link"></span></a>Signal Details</h2>

<h3>
<a name="the-activesessionchanged-signal" class="anchor" href="#the-activesessionchanged-signal"><span class="octicon octicon-link"></span></a>The ActiveSessionChanged signal</h3>

<pre><code>ActiveSessionChanged ('o'ssid)
</code></pre>

<p>Emitted when the active session has changed.</p>

<p><em><code>ssid</code></em>:</p>

<pre><code>Session ID
</code></pre>

<h3>
<a name="the-sessionadded-signal" class="anchor" href="#the-sessionadded-signal"><span class="octicon octicon-link"></span></a>The SessionAdded signal</h3>

<pre><code>SessionAdded ('o'ssid)
</code></pre>

<p>Emitted when a session has been added to the seat.</p>

<p><em><code>ssid</code></em>:</p>

<pre><code>Session ID
</code></pre>

<h3>
<a name="the-sessionremoved-signal" class="anchor" href="#the-sessionremoved-signal"><span class="octicon octicon-link"></span></a>The SessionRemoved signal</h3>

<pre><code>SessionRemoved ('o'ssid)
</code></pre>

<p>Emitted when a session has been removed from the seat.</p>

<p><em><code>ssid</code></em>:</p>

<pre><code>Session ID
</code></pre>

<h3>
<a name="the-deviceadded-signal" class="anchor" href="#the-deviceadded-signal"><span class="octicon octicon-link"></span></a>The DeviceAdded signal</h3>

<pre><code>DeviceAdded ('(ss)'device)
</code></pre>

<p>Emitted when a device has been associated with the seat.</p>

<p><em><code>device</code></em>:</p>

<pre><code>Device structure
</code></pre>

<h3>
<a name="the-deviceremoved-signal" class="anchor" href="#the-deviceremoved-signal"><span class="octicon octicon-link"></span></a>The DeviceRemoved signal</h3>

<pre><code>DeviceRemoved ('(ss)'device)
</code></pre>

<p>Emitted when a device has been dissociated from the seat.</p>

<p><em><code>device</code></em>:</p>

<pre><code>Device structure
</code></pre>

<hr>

<h2>
<a name="name-2" class="anchor" href="#name-2"><span class="octicon octicon-link"></span></a>Name</h2>

<p>org.freedesktop.ConsoleKit.Session — Session interface</p>

<h2>
<a name="methods-2" class="anchor" href="#methods-2"><span class="octicon octicon-link"></span></a>Methods</h2>

<pre><code>GetId(out'o'ssid)
GetSeatId(out'o'sid)
GetSessionType(out's'type)
GetUser(out'u'uid)
GetUnixUser(out'u'uid)
GetX11Display(out's'display)
GetX11DisplayDevice(out's'x11_display_device)
GetDisplayDevice(out's'display_device)
GetRemoteHostName(out's'remote_host_name)
GetLoginSessionId(out's'login_session_id)
IsActive(out'b'active)
IsLocal(out'b'local)
GetCreationTime(out's'iso8601_datetime)
Activate()
Lock()
Unlock()
GetIdleHint(out'b'idle_hint)
GetIdleSinceHint(out's'iso8601_datetime)
SetIdleHint(in'b'idle_hint)
</code></pre>

<h2>
<a name="signals-2" class="anchor" href="#signals-2"><span class="octicon octicon-link"></span></a>Signals</h2>

<pre><code>ActiveChanged('b'is_active)
IdleHintChanged('b'hint)
Lock()
Unlock()
</code></pre>

<h2>
<a name="implemented-interfaces-2" class="anchor" href="#implemented-interfaces-2"><span class="octicon octicon-link"></span></a>Implemented Interfaces</h2>

<p>Objects implementing org.freedesktop.ConsoleKit.Session also implements
org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties</p>

<h2>
<a name="properties" class="anchor" href="#properties"><span class="octicon octicon-link"></span></a>Properties</h2>

<pre><code>'unix-user'readwrite'u'
'user'readwrite'u'
'session-type'readwrite's'
'remote-host-name'readwrite's'
'display-device'readwrite's'
'x11-display'readwrite's'
'x11-display-device'readwrite's'
'active'readwrite'b'
'is-local'readwrite'b'
'idle-hint'readwrite'b'
</code></pre>

<h2>
<a name="description-2" class="anchor" href="#description-2"><span class="octicon octicon-link"></span></a>Description</h2>

<p>Session objects represent and store information related to a user session.</p>

<p>The properties associated with the Session specifically refer to the
properties of the "session leader".</p>

<h2>
<a name="details-2" class="anchor" href="#details-2"><span class="octicon octicon-link"></span></a>Details</h2>

<h3>
<a name="getid--1" class="anchor" href="#getid--1"><span class="octicon octicon-link"></span></a>GetId ()</h3>

<pre><code>GetId (out'o'ssid)
</code></pre>

<p>Returns the ID for Session.</p>

<p><em><code>ssid</code></em>:</p>

<pre><code>Session ID
</code></pre>

<h3>
<a name="getseatid-" class="anchor" href="#getseatid-"><span class="octicon octicon-link"></span></a>GetSeatId ()</h3>

<pre><code>GetSeatId (out'o'sid)
</code></pre>

<p>Returns the ID for the Seat the Session is attached to.</p>

<p><em><code>sid</code></em>:</p>

<pre><code>Seat ID
</code></pre>

<p>See also: org.freedesktop.ConsoleKit.Seat</p>

<h3>
<a name="getsessiontype-" class="anchor" href="#getsessiontype-"><span class="octicon octicon-link"></span></a>GetSessionType ()</h3>

<pre><code>GetSessionType (out's'type)
</code></pre>

<p>Returns the type of the session.</p>

<p>Warning: we haven't yet defined the allowed values for this property. It is
probably best to avoid this until we do.</p>

<p><em><code>type</code></em>:</p>

<pre><code>Session type
</code></pre>

<p>See also: <code>session-type</code></p>

<h3>
<a name="getuser-" class="anchor" href="#getuser-"><span class="octicon octicon-link"></span></a>GetUser ()</h3>

<pre><code>GetUser (out'u'uid)
</code></pre>

<p>Returns the user that the session belongs to.</p>

<p><em><code>uid</code></em>:</p>

<pre><code>User ID
</code></pre>

<h3>
<a name="warning-1" class="anchor" href="#warning-1"><span class="octicon octicon-link"></span></a>Warning</h3>

<p><code>GetUser</code> is deprecated since version 0.1.3 and should not be used in newly-
written code. Use <code>GetUnixUser</code> instead.</p>

<p>See also: <code>user</code></p>

<h3>
<a name="getunixuser-" class="anchor" href="#getunixuser-"><span class="octicon octicon-link"></span></a>GetUnixUser ()</h3>

<pre><code>GetUnixUser (out'u'uid)
</code></pre>

<p>Returns the POSIX user ID that the session belongs to.</p>

<p><em><code>uid</code></em>:</p>

<pre><code>POSIX User ID
</code></pre>

<p>See also: <code>unix-user</code></p>

<h3>
<a name="getx11display-" class="anchor" href="#getx11display-"><span class="octicon octicon-link"></span></a>GetX11Display ()</h3>

<pre><code>GetX11Display (out's'display)
</code></pre>

<p>Returns the value of the X11 DISPLAY for this session if one is present.</p>

<p><em><code>display</code></em>:</p>

<pre><code>The value of the X11 display
</code></pre>

<p>See also: <code>x11-display</code></p>

<h3>
<a name="getx11displaydevice-" class="anchor" href="#getx11displaydevice-"><span class="octicon octicon-link"></span></a>GetX11DisplayDevice ()</h3>

<pre><code>GetX11DisplayDevice (out's'x11_display_device)
</code></pre>

<p>Returns the value of the display device (aka TTY) that the X11 display for the
session is connected to. If there is no x11-display set then this value is
undefined.</p>

<p><em><code>x11_display_device</code></em>:</p>

<pre><code>The value of the X11 display device
</code></pre>

<p>See also: <code>x11-display-device</code></p>

<h3>
<a name="getdisplaydevice-" class="anchor" href="#getdisplaydevice-"><span class="octicon octicon-link"></span></a>GetDisplayDevice ()</h3>

<pre><code>GetDisplayDevice (out's'display_device)
</code></pre>

<p>Returns the value of the display device (aka TTY) that the session is
connected to.</p>

<p><em><code>display_device</code></em>:</p>

<pre><code>The value of the display device
</code></pre>

<p>See also: <code>display-device</code></p>

<h3>
<a name="getremotehostname-" class="anchor" href="#getremotehostname-"><span class="octicon octicon-link"></span></a>GetRemoteHostName ()</h3>

<pre><code>GetRemoteHostName (out's'remote_host_name)
</code></pre>

<p>Returns the value of the remote host name for the session.</p>

<p><em><code>remote_host_name</code></em>:</p>

<pre><code>The remote host name
</code></pre>

<p>See also: <code>remote-host-name</code></p>

<h3>
<a name="getloginsessionid-" class="anchor" href="#getloginsessionid-"><span class="octicon octicon-link"></span></a>GetLoginSessionId ()</h3>

<pre><code>GetLoginSessionId (out's'login_session_id)
</code></pre>

<p>Returns the value of the login session ID that the underlying system uses to
enforce session boundaries. If there is no login session ID set then this
value is an empty string.</p>

<p><em><code>login_session_id</code></em>:</p>

<pre><code>The value of the native system login session ID
</code></pre>

<h3>
<a name="isactive-" class="anchor" href="#isactive-"><span class="octicon octicon-link"></span></a>IsActive ()</h3>

<pre><code>IsActive (out'b'active)
</code></pre>

<p>Returns whether the session is active on the Seat that it is attached to.</p>

<p>If the session is not attached to a seat this value is undefined.</p>

<p><em><code>active</code></em>:</p>

<pre><code>TRUE if the session is active, otherwise FALSE
</code></pre>

<p>See also: <code>active</code></p>

<h3>
<a name="islocal-" class="anchor" href="#islocal-"><span class="octicon octicon-link"></span></a>IsLocal ()</h3>

<pre><code>IsLocal (out'b'local)
</code></pre>

<p>Returns whether the session is local</p>

<p>FIXME: we need to come up with a concrete definition for this value. It was
originally used as a way to identify XDMCP sessions that originate from a
remote system.</p>

<p><em><code>local</code></em>:</p>

<pre><code>TRUE if the session is local, otherwise FALSE
</code></pre>

<p>See also: <code>is-local</code></p>

<h3>
<a name="getcreationtime-" class="anchor" href="#getcreationtime-"><span class="octicon octicon-link"></span></a>GetCreationTime ()</h3>

<pre><code>GetCreationTime (out's'iso8601_datetime)
</code></pre>

<p>Returns an ISO 8601 date-time string that corresponds to the time that the
session was opened.</p>

<p><em><code>iso8601_datetime</code></em>:</p>

<pre><code>An ISO 8601 format date-type string
</code></pre>

<h3>
<a name="activate-" class="anchor" href="#activate-"><span class="octicon octicon-link"></span></a>Activate ()</h3>

<pre><code>Activate ()
</code></pre>

<p>Attempt to activate the this session. In most cases, if successful, this will
cause the session to become visible and become active on the seat that it is
attached to.</p>

<p>See also: <code>Seat.ActivateSession()</code></p>

<h3>
<a name="lock-" class="anchor" href="#lock-"><span class="octicon octicon-link"></span></a>Lock ()</h3>

<pre><code>Lock ()
</code></pre>

<p>This will cause a <code>Lock</code> signal to be emitted for this session.</p>

<h3>
<a name="permissions-1" class="anchor" href="#permissions-1"><span class="octicon octicon-link"></span></a>Permissions</h3>

<p>This method is restricted to privileged users by D-Bus policy.</p>

<p>See also: <code>Lock signal</code></p>

<h3>
<a name="unlock-" class="anchor" href="#unlock-"><span class="octicon octicon-link"></span></a>Unlock ()</h3>

<pre><code>Unlock ()
</code></pre>

<p>This will cause an <code>Unlock</code> signal to be emitted for this session.</p>

<p>This can be used by login managers to unlock a session before it is re-
activated during fast-user-switching.</p>

<h3>
<a name="permissions-2" class="anchor" href="#permissions-2"><span class="octicon octicon-link"></span></a>Permissions</h3>

<p>This method is restricted to privileged users by D-Bus policy.</p>

<p>See also: <code>Unlock signal</code></p>

<h3>
<a name="getidlehint-" class="anchor" href="#getidlehint-"><span class="octicon octicon-link"></span></a>GetIdleHint ()</h3>

<pre><code>GetIdleHint (out'b'idle_hint)
</code></pre>

<p>Gets the value of the <code>idle-hint</code> property.</p>

<p><em><code>idle_hint</code></em>:</p>

<pre><code>The value of the idle-hint
</code></pre>

<p>See also: <code>idle-hint</code></p>

<h3>
<a name="getidlesincehint-" class="anchor" href="#getidlesincehint-"><span class="octicon octicon-link"></span></a>GetIdleSinceHint ()</h3>

<pre><code>GetIdleSinceHint (out's'iso8601_datetime)
</code></pre>

<p>Returns an ISO 8601 date-time string that corresponds to the time of the last
change of the idle-hint.</p>

<p><em><code>iso8601_datetime</code></em>:</p>

<pre><code>An ISO 8601 format date-type string
</code></pre>

<h3>
<a name="setidlehint-" class="anchor" href="#setidlehint-"><span class="octicon octicon-link"></span></a>SetIdleHint ()</h3>

<pre><code>SetIdleHint (in'b'idle_hint)
</code></pre>

<p>This may be used by the session to indicate that it is idle.</p>

<p>Use of this method is restricted to the user that owns the session.</p>

<p><em><code>idle_hint</code></em>:</p>

<pre><code>boolean value to set the idle-hint to
</code></pre>

<h2>
<a name="signal-details-2" class="anchor" href="#signal-details-2"><span class="octicon octicon-link"></span></a>Signal Details</h2>

<h3>
<a name="the-activechanged-signal" class="anchor" href="#the-activechanged-signal"><span class="octicon octicon-link"></span></a>The ActiveChanged signal</h3>

<pre><code>ActiveChanged ('b'is_active)
</code></pre>

<p>Emitted when the active property has changed.</p>

<p><em><code>is_active</code></em>:</p>

<pre><code>TRUE if the session is active, otherwise FALSE
</code></pre>

<h3>
<a name="the-idlehintchanged-signal" class="anchor" href="#the-idlehintchanged-signal"><span class="octicon octicon-link"></span></a>The IdleHintChanged signal</h3>

<pre><code>IdleHintChanged ('b'hint)
</code></pre>

<p>Emitted when the idle-hint property has changed.</p>

<p><em><code>hint</code></em>:</p>

<pre><code>the new value of idle-hint
</code></pre>

<h3>
<a name="the-lock-signal" class="anchor" href="#the-lock-signal"><span class="octicon octicon-link"></span></a>The Lock signal</h3>

<pre><code>Lock ()
</code></pre>

<p>Emitted in response to a call to the <code>Lock()</code> method.</p>

<p>It is intended that the screensaver for the session should lock the screen in
response to this signal.</p>

<h3>
<a name="the-unlock-signal" class="anchor" href="#the-unlock-signal"><span class="octicon octicon-link"></span></a>The Unlock signal</h3>

<pre><code>Unlock ()
</code></pre>

<p>Emitted in response to a call to the <code>Unlock()</code> method.</p>

<p>It is intended that the screensaver for the session should unlock the screen
in response to this signal.</p>

<h2>
<a name="property-details" class="anchor" href="#property-details"><span class="octicon octicon-link"></span></a>Property Details</h2>

<h3>
<a name="the-unix-user-property" class="anchor" href="#the-unix-user-property"><span class="octicon octicon-link"></span></a>The "unix-user" property</h3>

<pre><code>'unix-user'readwrite'u'
</code></pre>

<p>The user assigned to the session.</p>

<h3>
<a name="the-user-property" class="anchor" href="#the-user-property"><span class="octicon octicon-link"></span></a>The "user" property</h3>

<pre><code>'user'readwrite'u'
</code></pre>

<p>The user assigned to the session.</p>

<h3>
<a name="warning-2" class="anchor" href="#warning-2"><span class="octicon octicon-link"></span></a>Warning</h3>

<p><code>user</code> is deprecated since version 0.1.3 and should not be used in newly-
written code. Use <code>unix-user</code> instead.</p>

<h3>
<a name="the-session-type-property" class="anchor" href="#the-session-type-property"><span class="octicon octicon-link"></span></a>The "session-type" property</h3>

<pre><code>'session-type'readwrite's'
</code></pre>

<p>The type of the session.</p>

<p>Warning: we haven't yet defined the allowed values for this property. It is
probably best to avoid this until we do.</p>

<h3>
<a name="the-remote-host-name-property" class="anchor" href="#the-remote-host-name-property"><span class="octicon octicon-link"></span></a>The "remote-host-name" property</h3>

<pre><code>'remote-host-name'readwrite's'
</code></pre>

<p>The remote host name for the session.</p>

<p>This will be set in situations where the session is opened and controlled from
a remote system.</p>

<p>For example, this value will be set when the session is created from an SSH or
XDMCP connection.</p>

<h3>
<a name="the-display-device-property" class="anchor" href="#the-display-device-property"><span class="octicon octicon-link"></span></a>The "display-device" property</h3>

<pre><code>'display-device'readwrite's'
</code></pre>

<p>The display device (aka TTY) that the session is connected to.</p>

<h3>
<a name="the-x11-display-property" class="anchor" href="#the-x11-display-property"><span class="octicon octicon-link"></span></a>The "x11-display" property</h3>

<pre><code>'x11-display'readwrite's'
</code></pre>

<p>Value of the X11 DISPLAY for this session if one is present.</p>

<h3>
<a name="the-x11-display-device-property" class="anchor" href="#the-x11-display-device-property"><span class="octicon octicon-link"></span></a>The "x11-display-device" property</h3>

<pre><code>'x11-display-device'readwrite's'
</code></pre>

<p>The display device (aka TTY) that the X11 display for the session is connected
to. If there is no x11-display set then this value is undefined.</p>

<h3>
<a name="the-active-property" class="anchor" href="#the-active-property"><span class="octicon octicon-link"></span></a>The "active" property</h3>

<pre><code>'active'readwrite'b'
</code></pre>

<p>Whether the session is active on the Seat that it is attached to.</p>

<p>If the session is not attached to a seat this value is undefined.</p>

<h3>
<a name="the-is-local-property" class="anchor" href="#the-is-local-property"><span class="octicon octicon-link"></span></a>The "is-local" property</h3>

<pre><code>'is-local'readwrite'b'
</code></pre>

<p>Whether the session is local</p>

<p>FIXME: we need to come up with a concrete definition for this value. It was
originally used as a way to identify XDMCP sessions that originate from a
remote system.</p>

<h3>
<a name="the-idle-hint-property" class="anchor" href="#the-idle-hint-property"><span class="octicon octicon-link"></span></a>The "idle-hint" property</h3>

<pre><code>'idle-hint'readwrite'b'
</code></pre>

<p>This is a hint used to indicate that the session may be idle.</p>

<p>For sessions with a <code>x11-display</code> set (ie. graphical sessions), it is up to
each session to delegate the responsibility for updating this value.
Typically, the screensaver will set this.</p>

<p>However, for non-graphical sessions with a <code>display-device</code> set the Session
object itself will periodically update this value based on the activity
detected on the display-device itself.</p>

<p>This should not be considered authoritative.</p>
      </section>
    </div>

    <!-- FOOTER  -->
    <div id="footer_wrap" class="outer">
      <footer class="inner">
        <p class="copyright">Consolekit2 maintained by <a href="https://github.com/ConsoleKit2">ConsoleKit2</a></p>
        <p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
      </footer>
    </div>

    

  </body>
</html>