diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2012-02-09 16:33:51 +1100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2012-02-09 16:33:51 +1100 |
commit | 070f8c5a5ea91573507de655df886f538c82a85b (patch) | |
tree | 344760e8ec2d10c64b7c9205fa050d8702091f9f /utils | |
parent | 58e07cc142715296b06f226ba0fe0fa9edc2b164 (diff) | |
download | lightdm-070f8c5a5ea91573507de655df886f538c82a85b.tar.gz |
Add Lock D-Bus method that locks the seat and provides a hint to the greeter to be in lock mode
Diffstat (limited to 'utils')
-rw-r--r-- | utils/dm-tool.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/dm-tool.c b/utils/dm-tool.c index 2d2c65a3..d955efd1 100644 --- a/utils/dm-tool.c +++ b/utils/dm-tool.c @@ -101,6 +101,7 @@ main (int argc, char **argv) " switch-to-greeter Switch to the greeter\n" " switch-to-user USERNAME [SESSION] Switch to a user session\n" " switch-to-guest [SESSION] Switch to a guest session\n" + " lock Lock the current seat\n" " list-seats List the active seats\n" " add-nested-seat Start a nested display\n" " add-local-x-seat DISPLAY_NUMBER Add a local X seat\n" @@ -247,6 +248,28 @@ main (int argc, char **argv) } return EXIT_SUCCESS; } + else if (strcmp (command, "lock") == 0) + { + if (n_options != 0) + { + g_printerr ("Usage lock\n"); + usage (); + return EXIT_FAILURE; + } + + if (!g_dbus_proxy_call_sync (seat_proxy, + "Lock", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error)) + { + g_printerr ("Unable to lock seat: %s\n", error->message); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; + } else if (strcmp (command, "list-seats") == 0) { GVariant *seats, *sessions; |