chore: use same laptop display check as cosmic-comp

This commit is contained in:
Ashley Wulber 2025-10-02 11:38:26 -04:00 • committed by Ashley Wulber
parent 2482ec709b
commit 4e17382b14

View file

@ -7,16 +7,15 @@ pub fn display_name(name: &str, physical: (u32, u32)) -> String {
let inches = ((physical.0.pow(2) + physical.1.pow(2)) as f32).sqrt() * 0.039_370_1; let inches = ((physical.0.pow(2) + physical.1.pow(2)) as f32).sqrt() * 0.039_370_1;
let inches_string = format!("{inches:.1}\""); let inches_string = format!("{inches:.1}\"");
match name { if name.starts_with("eDP-") || name.starts_with("LVDS-") || name.starts_with("DSI-") {
"eDP-1" | "LVDS1" => {
fl!("display", "laptop", size = inches_string.as_str()) fl!("display", "laptop", size = inches_string.as_str())
} } else {
output => fl!( fl!(
"display", "display",
"external", "external",
size = inches_string.as_str(), size = inches_string.as_str(),
output = output output = name
), )
} }
} }