From d086af9567095f9b46d11f083a38529c468f8047 Mon Sep 17 00:00:00 2001 From: Marcin Szydelski Date: May 04 2021 09:02:28 +0000 Subject: Merge pull request #45 from pop-os/master Document that a reboot is required after switching --- diff --git a/README.md b/README.md index e4277c2..d2b7523 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Repo is available here: https://copr.fedorainfracloud.org/coprs/szydell/system76 ## Graphics Modes +A reboot is **required** for changes to take effect after switching modes. + ### Integrated The integrated graphics controller on the Intel or AMD CPU is used exclusively. diff --git a/src/client.rs b/src/client.rs index 0894cc4..0046eb6 100644 --- a/src/client.rs +++ b/src/client.rs @@ -84,7 +84,11 @@ impl Power for PowerClient { fn set_graphics(&mut self, vendor: &str) -> Result<(), String> { println!("setting graphics to {}", vendor); - self.call_method::<&str>("SetGraphics", Some(vendor)).map(|_| ()) + let r = self.call_method::<&str>("SetGraphics", Some(vendor)).map(|_| ()); + if r.is_ok() { + println!("reboot for changes to take effect"); + } + r } fn get_graphics_power(&mut self) -> Result { diff --git a/src/main.rs b/src/main.rs index d37b473..e6fdecd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,7 @@ fn main() { .long_about( "Query or set the graphics mode.\n\n - If an argument is not provided, the \ graphics profile will be queried\n - Otherwise, that profile will be set, if \ - it is a valid profile", + it is a valid profile\n\nA reboot is required after switching modes.", ) .subcommand( SubCommand::with_name("compute")