Fix slash enable

This commit is contained in:
Luke Jones
2025-02-17 11:38:29 +13:00
parent 5c3348a9f5
commit ae8ce83583
10 changed files with 112 additions and 51 deletions

View File

@@ -575,6 +575,7 @@ fn handle_slash(cmd: &SlashCommand) -> Result<(), Box<dyn std::error::Error>> {
&& cmd.show_on_sleep.is_none()
&& cmd.show_on_battery.is_none()
&& cmd.show_battery_warning.is_none()
// && cmd.show_on_lid_closed.is_none()
&& cmd.mode.is_none()
&& !cmd.list
&& !cmd.enable
@@ -620,6 +621,9 @@ fn handle_slash(cmd: &SlashCommand) -> Result<(), Box<dyn std::error::Error>> {
if let Some(show) = cmd.show_battery_warning {
proxy.set_show_battery_warning(show)?;
}
// if let Some(show) = cmd.show_on_lid_closed {
// proxy.set_show_on_lid_closed(show)?;
// }
}
if cmd.list {
let res = SlashMode::list();

View File

@@ -26,6 +26,8 @@ pub struct SlashCommand {
pub show_on_sleep: Option<bool>,
#[options(short = "b", meta = "", help = "Show the animation on battery")]
pub show_on_battery: Option<bool>,
// #[options(short = "L", meta = "", help = "Show the animation on lid closed")]
// pub show_on_lid_closed: Option<bool>,
#[options(
short = "w",
meta = "",