mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-07 13:35:14 +02:00
feat(config): adds per animation configuration options
Originally static config only allows global config for animations. Since this refactor introduces abilty to add more type of animations, this change allows to configure `enabled`, `duration` and `style` state per animation type. Now each of them take either raw value or JSON object where keys are the animation types and values are desired config value. Also adds support for per animation configuration for komorebic commands.
This commit is contained in:
+21
-3
@@ -723,12 +723,18 @@ struct BorderImplementation {
|
||||
struct Animation {
|
||||
#[clap(value_enum)]
|
||||
boolean_state: BooleanState,
|
||||
/// Animation type to apply the state to. If not specified, sets global state
|
||||
#[clap(value_enum, short, long)]
|
||||
animation_type: Option<komorebi_client::AnimationPrefix>,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct AnimationDuration {
|
||||
/// Desired animation durations in ms
|
||||
duration: u64,
|
||||
/// Animation type to apply the duration to. If not specified, sets global duration
|
||||
#[clap(value_enum, short, long)]
|
||||
animation_type: Option<komorebi_client::AnimationPrefix>,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
@@ -742,6 +748,9 @@ struct AnimationStyle {
|
||||
/// Desired ease function for animation
|
||||
#[clap(value_enum, short, long, default_value = "linear")]
|
||||
style: komorebi_client::AnimationStyle,
|
||||
/// Animation type to apply the style to. If not specified, sets global style
|
||||
#[clap(value_enum, short, long)]
|
||||
animation_type: Option<komorebi_client::AnimationPrefix>,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
@@ -2539,16 +2548,25 @@ Stop-Process -Name:komorebi -ErrorAction SilentlyContinue
|
||||
send_message(&SocketMessage::ToggleTransparency)?;
|
||||
}
|
||||
SubCommand::Animation(arg) => {
|
||||
send_message(&SocketMessage::Animation(arg.boolean_state.into()))?;
|
||||
send_message(&SocketMessage::Animation(
|
||||
arg.boolean_state.into(),
|
||||
arg.animation_type,
|
||||
))?;
|
||||
}
|
||||
SubCommand::AnimationDuration(arg) => {
|
||||
send_message(&SocketMessage::AnimationDuration(arg.duration))?;
|
||||
send_message(&SocketMessage::AnimationDuration(
|
||||
arg.duration,
|
||||
arg.animation_type,
|
||||
))?;
|
||||
}
|
||||
SubCommand::AnimationFps(arg) => {
|
||||
send_message(&SocketMessage::AnimationFps(arg.fps))?;
|
||||
}
|
||||
SubCommand::AnimationStyle(arg) => {
|
||||
send_message(&SocketMessage::AnimationStyle(arg.style))?;
|
||||
send_message(&SocketMessage::AnimationStyle(
|
||||
arg.style,
|
||||
arg.animation_type,
|
||||
))?;
|
||||
}
|
||||
|
||||
SubCommand::ResizeDelta(arg) => {
|
||||
|
||||
Reference in New Issue
Block a user