From 7cbed5cd6df8adad9320fa29f2ba3765349159c2 Mon Sep 17 00:00:00 2001 From: amy Date: Thu, 27 Jan 2022 17:53:41 +0100 Subject: [PATCH] fix locales ( #5 ) --- .gitlab-ci.yml | 0 README.md | 5 +++++ src/functions/locale.rs | 12 ++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) mode change 100644 => 100755 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml old mode 100644 new mode 100755 diff --git a/README.md b/README.md index 7fde452..4bcff6c 100755 --- a/README.md +++ b/README.md @@ -88,6 +88,11 @@ jade desktops onyx jade desktops gnome ``` +### setup timeshift +```sh +jade setup-timeshift +``` + ## How to build: Tested on latest Cargo (1.60.0-nightly) diff --git a/src/functions/locale.rs b/src/functions/locale.rs index f3c5ed5..1527a63 100755 --- a/src/functions/locale.rs +++ b/src/functions/locale.rs @@ -24,9 +24,17 @@ pub fn set_locale(locale: String) { files::append_file("/mnt/etc/locale.gen", "en_US.UTF-8 UTF-8\n"), "add en_US.UTF-8 UTF-8 to locale.gen", ); - for i in locale.split(' ') { + for i in (0..locale.split(' ').count()).step_by(2) { files_eval( - files::append_file("/mnt/etc/locale.gen", format!("{}\n", i).as_str()), + files::append_file( + "/mnt/etc/locale.gen", + format!( + "{} {}\n", + locale.split(' ').collect::>()[i], + locale.split(' ').collect::>()[i + 1] + ) + .as_str(), + ), "add locales to locale.gen", ); }