Skip to content

Commit c68637b

Browse files
authored
fix: Prefer $XDG_CONFIG_HOME to $HOME/.config on Linux (#215)
1 parent bdb4932 commit c68637b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

apps/plumeimpactor/src/defaults.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ pub fn get_data_path() -> PathBuf {
6161
let base = if cfg!(windows) {
6262
env::var("APPDATA").unwrap()
6363
} else {
64-
env::var("HOME").unwrap() + "/.config"
64+
env::var("XDG_CONFIG_HOME").unwrap_or_else(|_| {
65+
env::var("HOME").unwrap() + "/.config"
66+
})
6567
};
6668

6769
let dir = Path::new(&base).join("PlumeImpactor");

apps/plumesign/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ pub fn get_data_path() -> PathBuf {
2828
let base = if cfg!(windows) {
2929
env::var("APPDATA").unwrap()
3030
} else {
31-
env::var("HOME").unwrap() + "/.config"
31+
env::var("XDG_CONFIG_HOME").unwrap_or_else(|_| {
32+
env::var("HOME").unwrap() + "/.config"
33+
})
3234
};
3335

3436
let dir = Path::new(&base).join("PlumeImpactor");

0 commit comments

Comments
 (0)