Update readme, slash configs

This commit is contained in:
Luke D. Jones
2025-01-12 17:36:10 +13:00
parent 2123f369ad
commit 128bc3fce1
113 changed files with 1545 additions and 1305 deletions

View File

@@ -32,7 +32,7 @@ const NOTIF_HEADER: &str = "ROG Control";
pub struct EnabledNotifications {
pub enabled: bool,
pub receive_notify_gfx: bool,
pub receive_notify_gfx_status: bool,
pub receive_notify_gfx_status: bool
}
impl Default for EnabledNotifications {
@@ -40,7 +40,7 @@ impl Default for EnabledNotifications {
Self {
enabled: true,
receive_notify_gfx: true,
receive_notify_gfx_status: true,
receive_notify_gfx_status: true
}
}
}
@@ -93,7 +93,7 @@ fn start_dpu_status_mon(config: Arc<Mutex<Config>>) {
pub fn start_notifications(
config: Arc<Mutex<Config>>,
rt: &Runtime,
rt: &Runtime
) -> Result<Vec<JoinHandle<()>>> {
// Setup the AC/BAT commands that will run on power status change
let config_copy = config.clone();
@@ -213,7 +213,7 @@ pub fn start_notifications(
supergfxctl::actions::UserActionRequired::Reboot => {
do_mux_notification("Graphics mode change requires reboot", &mode)
}
_ => do_gfx_action_notif(<&str>::from(action), *action, mode),
_ => do_gfx_action_notif(<&str>::from(action), *action, mode)
}
.map_err(|e| {
error!("zbus signal: do_gfx_action_notif: {e}");
@@ -265,13 +265,13 @@ fn convert_gfx_mode(gfx: GfxMode) -> GpuMode {
GfxMode::Vfio => GpuMode::Vfio,
GfxMode::AsusEgpu => GpuMode::Egpu,
GfxMode::AsusMuxDgpu => GpuMode::Ultimate,
GfxMode::None => GpuMode::Error,
GfxMode::None => GpuMode::Error
}
}
fn base_notification<T>(message: &str, data: &T) -> Notification
where
T: Display,
T: Display
{
let mut notif = Notification::new();
notif
@@ -289,7 +289,7 @@ fn do_gpu_status_notif(message: &str, data: &GfxPower) -> Notification {
GfxPower::Off => "asus_notif_green",
GfxPower::AsusDisabled => "asus_notif_white",
GfxPower::AsusMuxDiscreet | GfxPower::Active => "asus_notif_red",
GfxPower::Unknown => "gpu-integrated",
GfxPower::Unknown => "gpu-integrated"
};
notif.icon(icon);
notif
@@ -329,7 +329,9 @@ fn do_gfx_action_notif(message: &str, action: GfxUserAction, mode: GpuMode) -> R
handle.wait_for_action(|id| {
if id == "gfx-mode-session-action" {
let mut cmd = Command::new("qdbus");
cmd.args(["org.kde.ksmserver", "/KSMServer", "logout", "1", "0", "0"]);
cmd.args([
"org.kde.ksmserver", "/KSMServer", "logout", "1", "0", "0"
]);
cmd.spawn().ok();
} else if id == "__closed" {
// TODO: cancel the switching
@@ -371,7 +373,9 @@ fn do_mux_notification(message: &str, m: &GpuMode) -> Result<()> {
handle.wait_for_action(|id| {
if id == "gfx-mode-session-action" {
let mut cmd = Command::new("qdbus");
cmd.args(["org.kde.ksmserver", "/KSMServer", "logout", "1", "1", "0"]);
cmd.args([
"org.kde.ksmserver", "/KSMServer", "logout", "1", "1", "0"
]);
cmd.spawn().ok();
} else if id == "__closed" {
// TODO: cancel the switching