aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/tty.rs5
-rw-r--r--src/config.rs4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 381113dc..f091672f 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -431,6 +431,11 @@ impl Tty {
.cloned()
.unwrap_or_default();
+ if config.off {
+ debug!("output is disabled in the config");
+ return Ok(());
+ }
+
let device = self
.output_device
.as_mut()
diff --git a/src/config.rs b/src/config.rs
index a9b60dc9..58580f94 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -120,6 +120,8 @@ pub struct Tablet {
#[derive(knuffel::Decode, Debug, Clone, PartialEq)]
pub struct Output {
+ #[knuffel(child)]
+ pub off: bool,
#[knuffel(argument)]
pub name: String,
#[knuffel(child, unwrap(argument), default = 1.)]
@@ -133,6 +135,7 @@ pub struct Output {
impl Default for Output {
fn default() -> Self {
Self {
+ off: false,
name: String::new(),
scale: 1.,
position: None,
@@ -624,6 +627,7 @@ mod tests {
},
},
outputs: vec![Output {
+ off: false,
name: "eDP-1".to_owned(),
scale: 2.,
position: Some(Position { x: 10, y: 20 }),