mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Rebootless graphics switching
This changes out how the current graphics switching works, enabling asusd to stop/start the display-manager to enable/disable PCI devices and add/remove drivers as required. All existing graphics modes and commands still work as normal. G-Sync enable is now only through the bios setting, and on reboot will set all relevant settings to Nvidia mode.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, PartialEq, Copy, Clone, Deserialize, Serialize)]
|
||||
pub enum GfxVendors {
|
||||
Nvidia,
|
||||
Integrated,
|
||||
@@ -28,9 +30,9 @@ impl FromStr for GfxVendors {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&GfxVendors> for &str {
|
||||
fn from(mode: &GfxVendors) -> Self {
|
||||
match mode {
|
||||
impl Into<&str> for GfxVendors {
|
||||
fn into(self) -> &'static str {
|
||||
match self {
|
||||
GfxVendors::Nvidia => "nvidia",
|
||||
GfxVendors::Hybrid => "hybrid",
|
||||
GfxVendors::Compute => "compute",
|
||||
@@ -39,6 +41,17 @@ impl From<&GfxVendors> for &str {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<String> for GfxVendors {
|
||||
fn into(self) -> String {
|
||||
match self {
|
||||
GfxVendors::Nvidia => "nvidia".to_string(),
|
||||
GfxVendors::Hybrid => "hybrid".to_string(),
|
||||
GfxVendors::Compute => "compute".to_string(),
|
||||
GfxVendors::Integrated => "integrated".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum GfxCtrlAction {
|
||||
Reboot,
|
||||
|
||||
Reference in New Issue
Block a user