From 8a9d83632e1c56fe82f211550d6cfd2768af92a2 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 25 Oct 2023 10:05:13 -0600 Subject: [PATCH] Parse gecos csv --- src/greeter.rs | 6 ++++-- src/locker.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/greeter.rs b/src/greeter.rs index 31d26bc..ee5af64 100644 --- a/src/greeter.rs +++ b/src/greeter.rs @@ -508,8 +508,9 @@ impl cosmic::Application for App { } match &user.gecos { Some(gecos) => { + let full_name = gecos.split(",").next().unwrap_or(""); column = column.push( - widget::container(widget::text::title4(gecos)) + widget::container(widget::text::title4(full_name)) .width(Length::Fill) .align_x(alignment::Horizontal::Center), ); @@ -541,8 +542,9 @@ impl cosmic::Application for App { } match &user.gecos { Some(gecos) => { + let full_name = gecos.split(",").next().unwrap_or(""); column = column.push( - widget::container(widget::text::title4(gecos)) + widget::container(widget::text::title4(full_name)) .width(Length::Fill) .align_x(alignment::Horizontal::Center), ); diff --git a/src/locker.rs b/src/locker.rs index 6584c1e..e2f1eed 100644 --- a/src/locker.rs +++ b/src/locker.rs @@ -529,8 +529,9 @@ impl cosmic::Application for App { } match &self.flags.current_user.gecos { Some(gecos) => { + let full_name = gecos.split(",").next().unwrap_or(""); column = column.push( - widget::container(widget::text::title4(gecos)) + widget::container(widget::text::title4(full_name)) .width(Length::Fill) .align_x(alignment::Horizontal::Center), );