From fb02604dc65b5338bcf4188cb623aa1c493b494c Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 18 Apr 2020 13:31:07 +1200 Subject: [PATCH] Use systemctl to suspend --- rog-lib/src/laptops.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rog-lib/src/laptops.rs b/rog-lib/src/laptops.rs index ce3b7b2d..adec8ee6 100644 --- a/rog-lib/src/laptops.rs +++ b/rog-lib/src/laptops.rs @@ -114,6 +114,12 @@ impl Laptop for LaptopGX502GW { GX502GWKeys::ScreenBrightDown => { self.backlight.step_down(); } + GX502GWKeys::Sleep => { + std::process::Command::new("systemctl") + .arg("suspend") + .spawn() + .expect("failed to suspend"); + } _ => { if key_byte != 0 { dbg!(&key_byte);