Add global config fallback

Co-authored-by: Christian Duerr <contact@christianduerr.com>
This commit is contained in:
mBornandandChristian Duerr authored and GitHub committed 2025-07-07 21:44:55 +00:00
1 parent fad5360bf0
commit f440cd4d6d
5 files changed
+8 -1

No files matched your search

+1
View File
@@ -20,6 +20,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
- IPC config retrieval using `alacritty msg get-config`
- Multi-sequence touch zoom sequences
- Vi action `Y` keybind, yank to the end of line
- Add `/etc/alacritty/alacritty.toml` fallback for system wide configuration
### Changed
+1
View File
@@ -68,6 +68,7 @@ following locations:
2. `$XDG_CONFIG_HOME/alacritty.toml`
3. `$HOME/.config/alacritty/alacritty.toml`
4. `$HOME/.alacritty.toml`
5. `/etc/alacritty/alacritty.toml`
On Windows, the config file will be looked for in:
+4 -1
View File
@@ -368,6 +368,7 @@ fn prune_yaml_nulls(value: &mut serde_yaml::Value, warn_pruned: bool) {
/// 2. $XDG_CONFIG_HOME/alacritty.toml
/// 3. $HOME/.config/alacritty/alacritty.toml
/// 4. $HOME/.alacritty.toml
/// 5. /etc/alacritty/alacritty.toml
#[cfg(not(windows))]
pub fn installed_config(suffix: &str) -> Option<PathBuf> {
let file_name = format!("alacritty.{suffix}");
@@ -390,7 +391,9 @@ pub fn installed_config(suffix: &str) -> Option<PathBuf> {
return Some(fallback);
}
}
None
let fallback = PathBuf::from("/etc/alacritty").join(&file_name);
fallback.exists().then_some(fallback)
})
}
+1
View File
@@ -72,6 +72,7 @@ set of features with high performance.
. _$XDG_CONFIG_HOME/alacritty.toml_
. _$HOME/.config/alacritty/alacritty.toml_
. _$HOME/.alacritty.toml_
. _/etc/alacritty/alacritty.toml_
On Windows, the config file will be looked for in:
+1
View File
@@ -18,6 +18,7 @@ following locations on UNIX systems:
. _$XDG_CONFIG_HOME/alacritty.toml_
. _$HOME/.config/alacritty/alacritty.toml_
. _$HOME/.alacritty.toml_
. _/etc/alacritty/alacritty.toml_
On Windows, the config file will be looked for in: