mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
3aa6eee306
- Spawn tasks on individual threads - Don't force a default of fan-curve on reload - Add missing profile commands - Begin obsoleting the graphics switch command in favour of supergfxctl - Slim down the notification daemon to pure ASUS notifications Bad behaviour in fan-curve new function that was forcing a re-init to default on reload. Remove this and only save config again after loading the config file and writing a curve (hidden side effect of write is that a zeroed array is defaulted to read-from-system - this needs to be changed too). Closes #140, #139
93 lines
2.8 KiB
Rust
93 lines
2.8 KiB
Rust
use crate::{
|
|
anime_cli::AnimeCommand,
|
|
aura_cli::{LedBrightness, SetAuraBuiltin},
|
|
profiles_cli::{FanCurveCommand, ProfileCommand},
|
|
};
|
|
use gumdrop::Options;
|
|
|
|
#[derive(Default, Options)]
|
|
pub struct CliStart {
|
|
#[options(help_flag, help = "print help message")]
|
|
pub help: bool,
|
|
#[options(help = "show program version number")]
|
|
pub version: bool,
|
|
#[options(help = "show supported functions of this laptop")]
|
|
pub show_supported: bool,
|
|
#[options(meta = "", help = "<off, low, med, high>")]
|
|
pub kbd_bright: Option<LedBrightness>,
|
|
#[options(help = "Toggle to next keyboard brightness")]
|
|
pub next_kbd_bright: bool,
|
|
#[options(help = "Toggle to previous keyboard brightness")]
|
|
pub prev_kbd_bright: bool,
|
|
#[options(meta = "", help = "Set your battery charge limit <20-100>")]
|
|
pub chg_limit: Option<u8>,
|
|
#[options(command)]
|
|
pub command: Option<CliCommand>,
|
|
}
|
|
|
|
#[derive(Options)]
|
|
pub enum CliCommand {
|
|
#[options(help = "Set the keyboard lighting from built-in modes")]
|
|
LedMode(LedModeCommand),
|
|
#[options(help = "Set or select platform_profile")]
|
|
Profile(ProfileCommand),
|
|
#[options(help = "Set, select, or modify fan curves if supported")]
|
|
FanCurve(FanCurveCommand),
|
|
#[options(help = "Set the graphics mode (obsoleted by supergfxctl)")]
|
|
Graphics(GraphicsCommand),
|
|
#[options(name = "anime", help = "Manage AniMe Matrix")]
|
|
Anime(AnimeCommand),
|
|
#[options(help = "Change bios settings")]
|
|
Bios(BiosCommand),
|
|
}
|
|
|
|
#[derive(Options)]
|
|
pub struct LedModeCommand {
|
|
#[options(help = "print help message")]
|
|
pub help: bool,
|
|
#[options(help = "switch to next aura mode")]
|
|
pub next_mode: bool,
|
|
#[options(help = "switch to previous aura mode")]
|
|
pub prev_mode: bool,
|
|
#[options(
|
|
meta = "",
|
|
help = "set the keyboard LED to enabled while the device is awake"
|
|
)]
|
|
pub awake_enable: Option<bool>,
|
|
#[options(
|
|
meta = "",
|
|
help = "set the keyboard LED suspend animation to enabled while the device is suspended"
|
|
)]
|
|
pub sleep_enable: Option<bool>,
|
|
#[options(command)]
|
|
pub command: Option<SetAuraBuiltin>,
|
|
}
|
|
|
|
#[derive(Options)]
|
|
pub struct GraphicsCommand {
|
|
#[options(help = "print help message")]
|
|
pub help: bool,
|
|
}
|
|
|
|
#[derive(Options, Debug)]
|
|
pub struct BiosCommand {
|
|
#[options(help = "print help message")]
|
|
pub help: bool,
|
|
#[options(
|
|
meta = "",
|
|
no_long,
|
|
help = "set bios POST sound: asusctl -p <true/false>"
|
|
)]
|
|
pub post_sound_set: Option<bool>,
|
|
#[options(no_long, help = "read bios POST sound")]
|
|
pub post_sound_get: bool,
|
|
#[options(
|
|
meta = "",
|
|
no_long,
|
|
help = "activate dGPU dedicated/G-Sync: asusctl -d <true/false>, reboot required"
|
|
)]
|
|
pub dedicated_gfx_set: Option<bool>,
|
|
#[options(no_long, help = "get GPU mode")]
|
|
pub dedicated_gfx_get: bool,
|
|
}
|