diff --git a/doc/GUIDE.md b/doc/GUIDE.md index 36d9d299..19483c17 100644 --- a/doc/GUIDE.md +++ b/doc/GUIDE.md @@ -24,7 +24,7 @@ unzip plato-launcher-fmon-VERSION.zip -d SD_ROOT ## Configure -The default library path is `/mnt/onboard`. If your library lives somewhere else, you'll need to create a file named `Settings.toml` in the same directory as the program's binary with the following content: +The default library path is `/mnt/onboard` on devices without an external SD card, and `/mnt/sd` otherwise. If your library lives somewhere else, you'll need to create a file named `Settings.toml` in the same directory as the program's binary with the following content: ```toml library-path = "LIBRARY_PATH" ``` diff --git a/src/device.rs b/src/device.rs index 43837b4d..9e92f96e 100644 --- a/src/device.rs +++ b/src/device.rs @@ -1,5 +1,6 @@ use std::env; use std::fmt; +use std::path::PathBuf; use std::collections::HashMap; use lazy_static::lazy_static; use crate::unit::scale_by_dpi; @@ -69,6 +70,18 @@ pub enum FrontlightKind { } impl Device { + pub fn library_path(&self) -> PathBuf { + match self.model { + Model::AuraH2O | + Model::Aura | + Model::AuraHD | + Model::Mini | + Model::Glo | + Model::Touch => PathBuf::from("/mnt/sd"), + _ => PathBuf::from("/mnt/onboard"), + } + } + pub fn frontlight_kind(&self) -> FrontlightKind { match self.model { Model::AuraONE | diff --git a/src/settings/mod.rs b/src/settings/mod.rs index bc71d200..e4c8c9d0 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -251,7 +251,7 @@ impl Default for BatterySettings { impl Default for Settings { fn default() -> Self { Settings { - library_path: PathBuf::from("/mnt/onboard"), + library_path: CURRENT_DEVICE.library_path(), frontlight: true, wifi: false, rotation_lock: None,