use freedesktop instead of gtk
This commit is contained in:
@@ -28,6 +28,7 @@ wlx-common = { path = "../wlx-common" }
|
||||
|
||||
anyhow.workspace = true
|
||||
clap.workspace = true
|
||||
freedesktop.workspace = true
|
||||
glam = { workspace = true, features = ["mint", "serde"] }
|
||||
idmap = { workspace = true, features = ["serde"] }
|
||||
idmap-derive. workspace = true
|
||||
@@ -85,7 +86,6 @@ winit = { version = "0.30.12", optional = true }
|
||||
xcb = { version = "1.6.0", optional = true, features = [
|
||||
"as-raw-xcb-connection",
|
||||
] }
|
||||
xdg = "3.0"
|
||||
xkbcommon = { version = "0.9.0" }
|
||||
|
||||
################################
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use freedesktop::xdg_config_home;
|
||||
use log::error;
|
||||
use std::{path::PathBuf, sync::LazyLock};
|
||||
|
||||
@@ -10,13 +11,10 @@ pub enum ConfigRoot {
|
||||
const FALLBACK_CONFIG_PATH: &str = "/tmp/wlxoverlay";
|
||||
|
||||
static CONFIG_ROOT_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
|
||||
if let Some(mut dir) = xdg::BaseDirectories::new().get_config_home() {
|
||||
dir.push("wlxoverlay");
|
||||
return dir;
|
||||
}
|
||||
//Return fallback config path
|
||||
error!("Err: Failed to find config path, using {FALLBACK_CONFIG_PATH}");
|
||||
PathBuf::from(FALLBACK_CONFIG_PATH)
|
||||
// Panics if $XDG_CONFIG_HOME and $HOME are both unset.
|
||||
let mut dir = xdg_config_home();
|
||||
dir.push("wlxoverlay");
|
||||
return dir;
|
||||
});
|
||||
|
||||
pub fn get_config_root() -> PathBuf {
|
||||
|
||||
Reference in New Issue
Block a user