1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2025-11-06 22:44:18 -05:00

Add global config fallback

Co-authored-by: Christian Duerr <contact@christianduerr.com>
This commit is contained in:
mBornand 2025-07-07 23:44:55 +02:00 committed by GitHub
parent fad5360bf0
commit f440cd4d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 1 deletions

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

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:

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)
})
}

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:

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: