Skip to content

Commit

Permalink
Merge pull request #4 from mathix420/fix-config-location
Browse files Browse the repository at this point in the history
Use XDG's recommendations to store config files
  • Loading branch information
revathskumar committed Jan 20, 2024
2 parents 7ad126a + 52d85eb commit cfad7e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ secret=yyyyyyyyyyyyyyyyyy

#### YAML config

Create file named `2fa.yml` in your home directory and add apps in the format
Create file named `2fa.yml` in `~/.config/rofi-totp` and add apps in the format

```yml
apps:
Expand Down
4 changes: 2 additions & 2 deletions src/yaml_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ pub fn get_list() -> Result<Vec<std::string::String>, String> {
}
};

let config_path = home_dir.join("2fa.yml");
let config_path = home_dir.join(".config").join("rofi-totp").join("2fa.yml");

let mut config_file = match File::open(&config_path) {
Err(_) => {
return Err(String::from("Make sure you have .gauth (ini) or 2fa.yml config file in home folder"));
return Err(String::from("Make sure you have created the following config file ~/.config/rofi-totp/2fa.yml"));
}
Ok(file) => file,
};
Expand Down

0 comments on commit cfad7e8

Please sign in to comment.