diff --git a/Cargo.toml b/Cargo.toml index 1bcd581..fcca7e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,3 +32,7 @@ panic = "abort" lto = true opt-level = 3 codegen-units = 1 + +[lib] +name = "chwd" +path = "src/lib.rs" diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..4eea965 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,21 @@ +// Copyright (C) 2024 Vladislav Nepogodin +// +// This file is part of CachyOS chwd. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +pub mod consts; +pub mod localization; +pub mod profile; diff --git a/src/main.rs b/src/main.rs index 1e96738..d11ac7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,16 +18,14 @@ pub mod args; pub mod console_writer; -pub mod consts; pub mod data; pub mod device; -pub mod localization; pub mod logger; pub mod misc; -pub mod profile; use misc::Transaction; -use profile::Profile; +use chwd::*; +use chwd::profile::Profile; use std::path::Path; use std::sync::Arc; @@ -40,7 +38,7 @@ use subprocess::{Exec, Redirection}; fn main() -> anyhow::Result<()> { let requested_languages = DesktopLanguageRequester::requested_languages(); - let localizer = crate::localization::localizer(); + let localizer = chwd::localization::localizer(); if let Err(error) = localizer.select(&requested_languages) { eprintln!("Error while loading languages for library_fluent {}", error); }