diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-07-10 22:32:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 22:32:44 +0300 |
commit | 8bd2c13490f8cb6ad6b0c1104f9586b3554efea2 (patch) | |
tree | 6909d3be00c72c3c5acdd173aa7f411a1bc6b445 /alacritty_terminal/src/config/mod.rs | |
parent | b78f3d133960dad38ad21e808723e51661b59881 (diff) | |
download | alacritty-8bd2c13490f8cb6ad6b0c1104f9586b3554efea2.tar.gz alacritty-8bd2c13490f8cb6ad6b0c1104f9586b3554efea2.zip |
Add option to run command on bell
Fixes #1528.
Diffstat (limited to 'alacritty_terminal/src/config/mod.rs')
-rw-r--r-- | alacritty_terminal/src/config/mod.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs index e3d72fda..83dcd7b8 100644 --- a/alacritty_terminal/src/config/mod.rs +++ b/alacritty_terminal/src/config/mod.rs @@ -6,20 +6,20 @@ use log::error; use serde::{Deserialize, Deserializer}; use serde_yaml::Value; +mod bell; mod colors; mod debug; mod font; mod scrolling; -mod visual_bell; mod window; use crate::ansi::CursorStyle; +pub use crate::config::bell::{BellAnimation, BellConfig}; pub use crate::config::colors::Colors; pub use crate::config::debug::Debug; pub use crate::config::font::{Font, FontDescription}; pub use crate::config::scrolling::Scrolling; -pub use crate::config::visual_bell::{VisualBellAnimation, VisualBellConfig}; pub use crate::config::window::{Decorations, Dimensions, StartupMode, WindowConfig, DEFAULT_NAME}; pub const LOG_TARGET_CONFIG: &str = "alacritty_config"; @@ -69,9 +69,9 @@ pub struct Config<T> { #[serde(default, deserialize_with = "failure_default")] pub config_path: Option<PathBuf>, - /// Visual bell configuration. + /// Bell configuration. #[serde(default, deserialize_with = "failure_default")] - pub visual_bell: VisualBellConfig, + bell: BellConfig, /// Use dynamic title. #[serde(default, deserialize_with = "failure_default")] @@ -114,6 +114,10 @@ pub struct Config<T> { #[serde(skip)] pub hold: bool, + // TODO: DEPRECATED + #[serde(default, deserialize_with = "failure_default")] + pub visual_bell: Option<BellConfig>, + // TODO: REMOVED #[serde(default, deserialize_with = "failure_default")] pub tabspaces: Option<usize>, @@ -176,6 +180,11 @@ impl<T> Config<T> { pub fn background_opacity(&self) -> f32 { self.background_opacity.0 as f32 } + + #[inline] + pub fn bell(&self) -> &BellConfig { + self.visual_bell.as_ref().unwrap_or(&self.bell) + } } #[serde(default)] |