diff --git a/ame.toml b/ame.toml index 439eef5..9d31ea6 100644 --- a/ame.toml +++ b/ame.toml @@ -1,4 +1,4 @@ -cache = "/home/ali/.ame" +cache = "~/.cache/ame" [backends] pacman = true diff --git a/src/main.rs b/src/main.rs index bacaac9..ccfba35 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,6 +42,8 @@ fn main() { if fs::read_to_string("/etc/ame.toml").expect("unable to open config file! (/etc/ame.toml)") != "" { confile.read_to_string(&mut config).expect("Unable to read the Config file (/etc/ame.toml)"); + let homepath = std::env::var("HOME").unwrap(); + config=config.replace("~", &homepath); configfile = toml::from_str(&config).unwrap(); } diff --git a/src/mods/config.rs b/src/mods/config.rs index ff50d75..d995e3c 100644 --- a/src/mods/config.rs +++ b/src/mods/config.rs @@ -41,6 +41,8 @@ pub fn printconfig() { let mut configfile: General = toml::from_str(&defaultconfig).unwrap(); if fs::read_to_string("/etc/ame.toml").expect("unable to open config file! (/etc/ame.toml)") != "" { confile.read_to_string(&mut config).expect("Unable to read the Config file (/etc/ame.toml)"); + let homepath = std::env::var("HOME").unwrap(); + config=config.replace("~", &homepath); configfile = toml::from_str(&config).unwrap(); } println!("\