docs
This commit is contained in:
@@ -13,8 +13,11 @@ pub struct Config {
|
|||||||
pub layouts: Vec<Layout>,
|
pub layouts: Vec<Layout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A configured layout
|
||||||
pub struct Layout {
|
pub struct Layout {
|
||||||
|
/// Layout name
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
/// If true, automatically enableable
|
||||||
pub automatic: bool,
|
pub automatic: bool,
|
||||||
/// Map of monitor name to OutputConfig
|
/// Map of monitor name to OutputConfig
|
||||||
pub outputs: HashMap<String, OutputConfig>,
|
pub outputs: HashMap<String, OutputConfig>,
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ use std::io::Read;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use crate::config::Monitor;
|
use crate::config::Monitor;
|
||||||
|
|
||||||
|
// Determine if the lid id closed.
|
||||||
|
// Returns true if the lid is known to be closed.
|
||||||
|
// Returns false if the lid is known to be open, or if the lid state is not known.
|
||||||
pub fn is_lid_closed(monitor: &Monitor) -> bool {
|
pub fn is_lid_closed(monitor: &Monitor) -> bool {
|
||||||
if let Some(lid) = &monitor.lid {
|
if let Some(lid) = &monitor.lid {
|
||||||
is_acpi_closed(lid)
|
is_acpi_closed(lid)
|
||||||
|
|||||||
Reference in New Issue
Block a user