diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 142cbb7e..a185bb7c 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -46,6 +46,7 @@ dependencies = [
"serde",
"serde_json",
"sysinfo",
+ "systemctl",
"tauri",
"tauri-build",
"tauri-plugin-log",
@@ -445,10 +446,10 @@ dependencies = [
"itoa 0.4.8",
"matches",
"phf 0.8.0",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"smallvec",
- "syn",
+ "syn 1.0.107",
]
[[package]]
@@ -457,8 +458,8 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e"
dependencies = [
- "quote",
- "syn",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -467,8 +468,8 @@ version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096"
dependencies = [
- "quote",
- "syn",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -495,10 +496,10 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
dependencies = [
"fnv",
"ident_case",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"strsim",
- "syn",
+ "syn 1.0.107",
]
[[package]]
@@ -508,8 +509,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
dependencies = [
"darling_core",
- "quote",
- "syn",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -523,6 +524,17 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "default-env"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f753eb82d29277e79efc625e84aecacfd4851ee50e05a8573a4740239a77bfd3"
+dependencies = [
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "syn 0.15.44",
+]
+
[[package]]
name = "derive_more"
version = "0.99.17"
@@ -530,10 +542,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"rustc_version 0.4.0",
- "syn",
+ "syn 1.0.107",
]
[[package]]
@@ -743,9 +755,9 @@ version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -954,9 +966,9 @@ dependencies = [
"heck 0.4.0",
"proc-macro-crate",
"proc-macro-error",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1049,9 +1061,9 @@ dependencies = [
"anyhow",
"proc-macro-crate",
"proc-macro-error",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1093,9 +1105,9 @@ dependencies = [
"log",
"mac",
"markup5ever",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1200,6 +1212,15 @@ dependencies = [
"cfg-if",
]
+[[package]]
+name = "itertools"
+version = "0.10.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+dependencies = [
+ "either",
+]
+
[[package]]
name = "itoa"
version = "0.4.8"
@@ -1586,9 +1607,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce"
dependencies = [
"proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1667,9 +1688,9 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1855,9 +1876,9 @@ dependencies = [
"phf_generator 0.8.0",
"phf_shared 0.8.0",
"proc-macro-hack",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1869,9 +1890,9 @@ dependencies = [
"phf_generator 0.10.0",
"phf_shared 0.10.0",
"proc-macro-hack",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -1966,9 +1987,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
"version_check",
]
@@ -1978,8 +1999,8 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"version_check",
]
@@ -1989,6 +2010,15 @@ version = "0.5.20+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
+[[package]]
+name = "proc-macro2"
+version = "0.4.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
+dependencies = [
+ "unicode-xid",
+]
+
[[package]]
name = "proc-macro2"
version = "1.0.49"
@@ -2007,13 +2037,22 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "quote"
+version = "0.6.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
+dependencies = [
+ "proc-macro2 0.4.30",
+]
+
[[package]]
name = "quote"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
dependencies = [
- "proc-macro2",
+ "proc-macro2 1.0.49",
]
[[package]]
@@ -2359,9 +2398,9 @@ version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -2381,9 +2420,9 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -2415,9 +2454,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082"
dependencies = [
"darling",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -2437,9 +2476,9 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -2568,8 +2607,8 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
dependencies = [
"phf_generator 0.10.0",
"phf_shared 0.10.0",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
]
[[package]]
@@ -2584,9 +2623,15 @@ version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e"
dependencies = [
- "strum_macros",
+ "strum_macros 0.22.0",
]
+[[package]]
+name = "strum"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
+
[[package]]
name = "strum_macros"
version = "0.22.0"
@@ -2594,9 +2639,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb"
dependencies = [
"heck 0.3.3",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
+]
+
+[[package]]
+name = "strum_macros"
+version = "0.24.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
+dependencies = [
+ "heck 0.4.0",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "rustversion",
+ "syn 1.0.107",
+]
+
+[[package]]
+name = "syn"
+version = "0.15.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
+dependencies = [
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "unicode-xid",
]
[[package]]
@@ -2605,8 +2674,8 @@ version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
dependencies = [
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"unicode-ident",
]
@@ -2651,6 +2720,18 @@ dependencies = [
"version-compare 0.1.1",
]
+[[package]]
+name = "systemctl"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4d4feccec257a06484c9564e71b1bc1008dc274130b3e37c17eb95b0df5ab26"
+dependencies = [
+ "default-env",
+ "itertools",
+ "strum 0.24.1",
+ "strum_macros 0.24.3",
+]
+
[[package]]
name = "tao"
version = "0.15.8"
@@ -2789,8 +2870,8 @@ dependencies = [
"json-patch",
"plist",
"png",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"regex",
"semver 1.0.16",
"serde",
@@ -2810,9 +2891,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "069319e5ecbe653a799b94b0690d9f9bf5d00f7b1d3989aa331c524d4e354075"
dependencies = [
"heck 0.4.0",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
"tauri-codegen",
"tauri-utils",
]
@@ -2888,8 +2969,8 @@ dependencies = [
"kuchiki",
"memchr",
"phf 0.10.1",
- "proc-macro2",
- "quote",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
"semver 1.0.16",
"serde",
"serde_json",
@@ -2907,7 +2988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c58de036c4d2e20717024de2a3c4bf56c301f07b21bc8ef9b57189fce06f1f3b"
dependencies = [
"quick-xml",
- "strum",
+ "strum 0.22.0",
"windows 0.39.0",
]
@@ -2957,9 +3038,9 @@ version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -3054,9 +3135,9 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -3146,6 +3227,12 @@ version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a"
+[[package]]
+name = "unicode-xid"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
+
[[package]]
name = "url"
version = "2.3.1"
@@ -3267,9 +3354,9 @@ dependencies = [
"bumpalo",
"log",
"once_cell",
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
"wasm-bindgen-shared",
]
@@ -3291,7 +3378,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
dependencies = [
- "quote",
+ "quote 1.0.23",
"wasm-bindgen-macro-support",
]
@@ -3301,9 +3388,9 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -3389,9 +3476,9 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac"
dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "proc-macro2 1.0.49",
+ "quote 1.0.23",
+ "syn 1.0.107",
]
[[package]]
@@ -3483,7 +3570,7 @@ version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7"
dependencies = [
- "syn",
+ "syn 1.0.107",
"windows-tokens",
]
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 836dfb3f..d2a89f51 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -21,12 +21,13 @@ tauri = { version = "1.2.3", features = ["api-all"] }
tauri-utils = "1.2.1"
log = "0.4.14"
sysinfo = "0.24.6"
+systemctl = "0.1.9"
[dependencies.tauri-plugin-log]
git = "https://github.com/tauri-apps/tauri-plugin-log"
branch = "dev"
[features]
-default = [ "custom-protocol" ]
-custom-protocol = [ "tauri/custom-protocol" ]
+default = ["custom-protocol"]
+custom-protocol = ["tauri/custom-protocol"]
[profile.release]
panic = "abort" # Strip expensive panic clean-up logic
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index b04ee09f..9a28dfb7 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -39,10 +39,7 @@ fn get_svg_icon(svgpath: String) -> String {
}
#[tauri::command]
fn get_sys_info() -> String {
- let mut sys = System::new_with_specifics(
- RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-);
-
+ let mut sys = System::new_with_specifics(RefreshKind::new().with_cpu(CpuRefreshKind::everything()),);
// First we update all information of our `System` struct.
sys.refresh_all();
let sys_info = json!( {
@@ -59,6 +56,17 @@ fn get_sys_info() -> String {
});
return sys_info.to_string();
}
+
+#[tauri::command]
+fn is_service_active(service: String) -> bool {
+ if let Ok(true) = systemctl::exists(&service) {
+ let is_active = systemctl::is_active(&service)
+ .unwrap();
+ return is_active;
+ }
+ return false;
+}
+
fn main() {
tauri::Builder::default()
.setup(|app| {
@@ -82,7 +90,7 @@ fn main() {
LogTarget::Webview,
]).build())
// This is where you pass in your commands
- .invoke_handler(tauri::generate_handler![run_shell_command,run_shell_command_with_result,get_sys_info,get_svg_icon])
+ .invoke_handler(tauri::generate_handler![run_shell_command,run_shell_command_with_result,get_sys_info,get_svg_icon,is_service_active])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
diff --git a/src/components/systemconfig/FsTrimServiceComponent.tsx b/src/components/systemconfig/FsTrimServiceComponent.tsx
new file mode 100644
index 00000000..76e94dac
--- /dev/null
+++ b/src/components/systemconfig/FsTrimServiceComponent.tsx
@@ -0,0 +1,91 @@
+import React, { useEffect, useState } from 'react';
+import { invoke } from '@tauri-apps/api/tauri';
+import { info } from 'tauri-plugin-log-api';
+import {
+ TagLabel,
+ chakra,
+ TagLeftIcon,
+ Tag,
+ IconButton,
+ Tooltip,
+ Card,
+ Divider,
+ CardBody,
+ CardFooter,
+} from '@chakra-ui/react';
+import { useTranslation } from 'react-i18next';
+import { FiCheck, FiHardDrive } from 'react-icons/fi';
+import { BsCheckAll } from 'react-icons/bs';
+
+type Props = {}
+
+const FsTrimServiceComponent = (props: Props) => {
+ const [isServiceActive, setIsServiceActive] = useState(false);
+ const [processing, setProcessing] = useState(false);
+ const { t } = useTranslation();
+ function isServiceRunning() {
+ invoke('is_service_active', {
+ service: 'fstrim.timer',
+ }).then((response) => {
+ setIsServiceActive(response as boolean);
+ });
+ }
+ useEffect(() => {
+ isServiceRunning();
+ }, []);
+ const setServiceStatus = () => {
+ setProcessing(true);
+ invoke('run_shell_command', {
+ command: 'systemctl enable fstrim.timer',
+ }).then((response) => {
+ info(response as string);
+ invoke('run_shell_command', {
+ command: 'systemctl start fstrim.timer',
+ }).then((responseSt) => {
+ info(responseSt as string);
+ isServiceRunning();
+ setProcessing(false);
+ });
+ });
+ };
+ return (
+
+
+ {t('fstrimDesc')}
+
+
+ button': {
+ minW: '136px',
+ },
+ }}
+ >
+
+
+ {t('fstrimTimerService')}
+
+ : }
+ />
+
+
+
+
+ );
+};
+
+export default FsTrimServiceComponent;
diff --git a/src/screens/ConfigurationScreen.tsx b/src/screens/ConfigurationScreen.tsx
index 04fcb9f0..5e7cb676 100644
--- a/src/screens/ConfigurationScreen.tsx
+++ b/src/screens/ConfigurationScreen.tsx
@@ -13,6 +13,8 @@ import React, { useState, useEffect } from 'react';
import { Command } from '@tauri-apps/api/shell';
import { useTranslation } from 'react-i18next';
import { useRecoilValue } from 'recoil';
+import { invoke } from '@tauri-apps/api/tauri';
+import { info } from 'tauri-plugin-log-api';
import KernelComponent from '../components/systemconfig/KernelComponent';
import SystemInfoComponent from '../components/systemconfig/SystemInfo';
import SystemUpdate from '../components/systemconfig/SystemUpdate';
@@ -20,11 +22,13 @@ import Mirrors from '../components/systemconfig/Mirrors';
import ManjaroSettingsModule from '../components/systemconfig/ManjaroSettingsModule';
import GnomeLayoutManager from '../components/systemconfig/GnomeLayoutMaganer';
import { liveState } from '../stores/LiveStore';
+import FsTrimServiceComponent from '../components/systemconfig/FsTrimServiceComponent';
const ConfigurationScreen: React.FC = () => {
const [isVisibleGnomeLayout, setIsVisibleGnomeLayout] = useState(false);
const [isVisibleMSM, setIsVisibleMSM] = useState(false);
const [isVisibleMCP, setIsVisibleMCP] = useState(false);
+ const [isHDD, setIsHDD] = useState(true);
const isLive = useRecoilValue(liveState);
const { t } = useTranslation();
const borderColor = useColorModeValue('gray.800', 'gray.500');
@@ -56,6 +60,31 @@ const ConfigurationScreen: React.FC = () => {
setIsVisibleMSM(true);
}
});
+
+ invoke('run_shell_command_with_result', {
+ command: "lsblk -oMOUNTPOINT,PKNAME -P | grep 'MOUNTPOINT=\"/\"'",
+ }).then((response) => {
+ if (response) {
+ const variables = (response as string).split(' ');
+ const mountNameSpec = variables[1].split('=')[1];
+ const mountName = mountNameSpec.replace(
+ /(\r\n|\n|\s|\r|\\n|\\"|")/gm,
+ '',
+ );
+ info(mountName);
+ if (mountName) {
+ invoke('run_shell_command_with_result', {
+ command: `cat /sys/block/${mountName}/queue/rotational`,
+ }).then((catResponse) => {
+ const isHdd = (catResponse as string).replace(
+ /(\r\n|\n|\s|\r|\\n|\\"|")/gm,
+ '',
+ );
+ setIsHDD(isHdd === '1');
+ });
+ }
+ }
+ });
});
return (
{
{t('mirrors')}
{t('updates')}
{!isLive && {t('kernels')}}
+ {!isHDD && {t('storage')}}
{t('settings')}
@@ -91,6 +121,11 @@ const ConfigurationScreen: React.FC = () => {
)}
+ {!isHDD && (
+
+
+
+ )}
{isVisibleMSM && }
diff --git a/src/translations/en.json b/src/translations/en.json
index 4449c52b..681c0d63 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -141,6 +141,10 @@
"gpu": "GPU",
"checkingForUpdates": "Checking for updates",
"searchPackagePlaceHolder": "Search the package...",
- "searchPlaceHolder": "Search..."
+ "searchPlaceHolder": "Search...",
+ "fstrimDesc": "If you use SSD (solid-state drives), fstrim service is useful for you. fstrim is used on a mounted file system to discard (trim) blocks that are not in use by the file system. To enable and start the fstrim timer service, you can use the below button(Twice password popup can be shown).",
+ "fstrimTimerEnableStart": "Enable and Start fstrim Timer Service",
+ "fstrimTimerService": "Fstrim Timer Service",
+ "storage": "Storage"
}
}
\ No newline at end of file