2023-09-29 16:02:45 -06:00
|
|
|
// Copyright 2023 System76 <info@system76.com>
|
2023-10-05 17:47:23 -06:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
2023-09-29 16:02:45 -06:00
|
|
|
|
2023-10-05 17:47:23 -06:00
|
|
|
mod greeter;
|
2023-10-06 13:37:38 -06:00
|
|
|
mod image_container;
|
2023-10-05 17:47:23 -06:00
|
|
|
mod locker;
|
2023-09-29 16:02:45 -06:00
|
|
|
|
2023-11-29 08:02:14 -07:00
|
|
|
#[cfg(feature = "logind")]
|
|
|
|
|
mod logind;
|
|
|
|
|
|
2023-09-29 16:02:45 -06:00
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
2023-10-02 14:38:00 -06:00
|
|
|
env_logger::init();
|
|
|
|
|
|
2023-10-05 17:47:23 -06:00
|
|
|
match pwd::Passwd::current_user() {
|
|
|
|
|
Some(current_user) => match current_user.name.as_str() {
|
|
|
|
|
"greeter" => greeter::main(),
|
|
|
|
|
_ => locker::main(current_user),
|
|
|
|
|
},
|
|
|
|
|
_ => Err("failed to determine current user".into()),
|
2023-09-29 16:02:45 -06:00
|
|
|
}
|
2023-09-29 09:24:35 -06:00
|
|
|
}
|