Add focus.sequence_timeout config option

main
Taeyeon Mori 2 years ago
parent 3dfb962654
commit fc1f0a58a0
  1. 13
      swayr/src/config.rs

@ -167,6 +167,17 @@ impl Config {
.expect("No focus.lockin_delay defined."), .expect("No focus.lockin_delay defined."),
) )
} }
pub fn get_focus_sequence_timeout(&self) -> Option<Duration> {
self.focus
.as_ref()
.and_then(|f| f.sequence_timeout)
.or_else(|| Focus::default().sequence_timeout)
.and_then(|d| match d {
0 => None,
_ => Some(Duration::from_millis(d)),
})
}
} }
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
@ -214,6 +225,7 @@ impl Layout {
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct Focus { pub struct Focus {
lockin_delay: Option<u64>, lockin_delay: Option<u64>,
sequence_timeout: Option<u64>,
} }
impl Default for Menu { impl Default for Menu {
@ -311,6 +323,7 @@ impl Default for Focus {
fn default() -> Self { fn default() -> Self {
Self { Self {
lockin_delay: Some(750), lockin_delay: Some(750),
sequence_timeout: None,
} }
} }
} }

Loading…
Cancel
Save