X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Floginctl.c;h=ebe9c1f16ce55be5cb62433cb7da8ecce67f99fa;hb=1b8689f94983b47bf190e77ddb03a8fc6af15fb3;hp=7e64066479f0ad3241d22457d07205bc12c24294;hpb=841aa8c0b484b96654b95d3c4e936e37da4c7dda;p=elogind.git diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 7e6406647..ebe9c1f16 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -271,6 +271,7 @@ typedef struct SessionStatusInfo { const char *class; const char *state; const char *scope; + const char *desktop; } SessionStatusInfo; typedef struct UserStatusInfo { @@ -363,6 +364,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li { "RemoteHost", "s", NULL, offsetof(SessionStatusInfo, remote_host) }, { "RemoteUser", "s", NULL, offsetof(SessionStatusInfo, remote_user) }, { "Service", "s", NULL, offsetof(SessionStatusInfo, service) }, + { "Desktop", "s", NULL, offsetof(SessionStatusInfo, desktop) }, { "Type", "s", NULL, offsetof(SessionStatusInfo, type) }, { "Class", "s", NULL, offsetof(SessionStatusInfo, class) }, { "Scope", "s", NULL, offsetof(SessionStatusInfo, scope) }, @@ -372,7 +374,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li { "Remote", "b", NULL, offsetof(SessionStatusInfo, remote) }, { "Timestamp", "t", NULL, offsetof(SessionStatusInfo, timestamp) }, { "User", "(uo)", prop_map_first_of_struct, offsetof(SessionStatusInfo, uid) }, - { "Seat", "(so)", prop_map_first_of_struct, offsetof(SessionStatusInfo, id) }, + { "Seat", "(so)", prop_map_first_of_struct, offsetof(SessionStatusInfo, seat) }, {} }; @@ -419,7 +421,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li printf("\n"); } - if (i.seat) { + if (!isempty(i.seat)) { printf("\t Seat: %s", i.seat); if (i.vtnr > 0) @@ -453,13 +455,18 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li printf("\n"); } else if (i.type) { - printf("\t Type: %s\n", i.type); + printf("\t Type: %s", i.type); if (i.class) printf("; class %s", i.class); + + printf("\n"); } else if (i.class) printf("\t Class: %s\n", i.class); + if (!isempty(i.desktop)) + printf("\t Desktop: %s\n", i.desktop); + if (i.state) printf("\t State: %s\n", i.state);