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 | |
| 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')
| -rw-r--r-- | atuin-client/config.toml | 4 | ||||
| -rw-r--r-- | atuin-client/src/settings.rs | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/atuin-client/config.toml b/atuin-client/config.toml index 9a094f88..1ddaa12e 100644 --- a/atuin-client/config.toml +++ b/atuin-client/config.toml @@ -148,6 +148,10 @@ enter_accept = true ## Timeout (in seconds) for acquiring a local database connection (sqlite) # local_timeout = 5 +## Set this to true and Atuin will minimize motion in the UI - timers will not update live, etc. +## Alternatively, set env NO_MOTION=true +# prefers_reduced_motion = false + #[stats] # Set commands where we should consider the subcommand for statistics. Eg, kubectl get vs just kubectl #common_subcommands = [ 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("_") |
