diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2024-02-01 15:17:29 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-01 15:17:29 +0000 |
| commit | 744f0059c2b503e8dc43a004d95b0a086af8c4e5 (patch) | |
| tree | b2497a11abc757017fd1da9e0bf9a16d10344175 /atuin-client/src/settings.rs | |
| parent | chore(ci): re-enable test cache, add separate check step (#1663) (diff) | |
| download | atuin-744f0059c2b503e8dc43a004d95b0a086af8c4e5.zip | |
feat: add prefers_reduced_motion flag (#1645)
* feat: add prefers_reduced_motion flag
* use NO_MOTION, and ensure type is bool
* update default config
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to 'atuin-client/src/settings.rs')
| -rw-r--r-- | atuin-client/src/settings.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index de6b10a4..833311c8 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -278,6 +278,7 @@ pub struct Settings { pub word_chars: String, pub scroll_context_lines: usize, pub history_format: String, + pub prefers_reduced_motion: bool, #[serde(with = "serde_regex", default = "RegexSet::empty")] pub history_filter: RegexSet, @@ -524,6 +525,13 @@ impl Settings { .set_default("keymap_mode", "emacs")? .set_default("keymap_mode_shell", "auto")? .set_default("keymap_cursor", HashMap::<String, String>::new())? + .set_default( + "prefers_reduced_motion", + std::env::var("NO_MOTION") + .ok() + .map(|_| config::Value::new(None, config::ValueKind::Boolean(true))) + .unwrap_or_else(|| config::Value::new(None, config::ValueKind::Boolean(false))), + )? .add_source( Environment::with_prefix("atuin") .prefix_separator("_") |
