Revert "fix: linux, window, workaround, mint, mate (#10146)" (#10184)

This reverts commit bd0a33e467.
This commit is contained in:
RustDesk
2024-12-05 11:44:37 +09:00
committed by GitHub
parent f13ef48cec
commit fe4094777f
6 changed files with 17 additions and 161 deletions

View File

@@ -13,35 +13,22 @@ pub const XDG_CURRENT_DESKTOP: &str = "XDG_CURRENT_DESKTOP";
pub struct Distro {
pub name: String,
pub id: String,
pub version_id: String,
}
impl Distro {
fn new() -> Self {
// to-do:
// 1. Remove `run_cmds`, read file once
// 2. Add more distro infos
let name = run_cmds("awk -F'=' '/^NAME=/ {print $2}' /etc/os-release")
.unwrap_or_default()
.trim()
.trim_matches('"')
.to_string();
let id = run_cmds("awk -F'=' '/^ID=/ {print $2}' /etc/os-release")
.unwrap_or_default()
.trim()
.trim_matches('"')
.to_string();
let version_id = run_cmds("awk -F'=' '/^VERSION_ID=/ {print $2}' /etc/os-release")
.unwrap_or_default()
.trim()
.trim_matches('"')
.to_string();
Self {
name,
id,
version_id,
}
Self { name, version_id }
}
}