shim linux theme check

Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
FTCHD
2025-10-29 22:47:57 +01:00
parent 6b10665ef5
commit 65e0a955ee
2 changed files with 15 additions and 5 deletions
+3 -1
View File
@@ -45,7 +45,6 @@ tauri-plugin-clipboard-manager = "2.3.0"
tauri-plugin-prevent-default = "3"
reqwest = { version = "0.11", features = ["json"] }
sysinfo = "0.37"
dark-light = "1.1.1"
[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.26"
@@ -53,3 +52,6 @@ cocoa = "0.26"
[target.'cfg(target_os = "linux")'.dependencies]
zbus = { version = "5" }
x11rb = "0.13"
[target.'cfg(not(target_os = "linux"))'.dependencies]
dark-light = "1.1.1"
+12 -4
View File
@@ -250,10 +250,18 @@ fn get_uid() -> String {
#[tauri::command]
fn get_system_theme() -> String {
match dark_light::detect() {
dark_light::Mode::Dark => "dark".to_string(),
dark_light::Mode::Light => "light".to_string(),
dark_light::Mode::Default => "unknown".to_string(),
#[cfg(not(target_os = "linux"))]
{
match dark_light::detect() {
dark_light::Mode::Dark => "dark".to_string(),
dark_light::Mode::Light => "light".to_string(),
dark_light::Mode::Default => "unknown".to_string(),
}
}
#[cfg(target_os = "linux")]
{
"unknown".to_string()
}
}