Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,13 @@ impl Config {

/// Constructs default path to config toml
pub fn default_config_path() -> PathBuf {
let Some(mut config_path) = dirs::home_dir() else {
panic!("Could not infer config file path.");
let config_path = match std::env::var("XDG_CONFIG_HOME") {
Ok(path) => PathBuf::from(path).join("rustscan.toml"),
Err(_) => dirs::home_dir()
.unwrap_or_else(|| panic!("Could not infer config file path."))
.join(".rustscan.toml"),
};
config_path.push(".rustscan.toml");

config_path
}

Expand Down