mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-15 09:32:52 +02:00
feat(cli): add toggle-transparency cmd
This commit is contained in:
@@ -150,6 +150,7 @@ pub enum SocketMessage {
|
|||||||
BorderOffset(i32),
|
BorderOffset(i32),
|
||||||
BorderImplementation(BorderImplementation),
|
BorderImplementation(BorderImplementation),
|
||||||
Transparency(bool),
|
Transparency(bool),
|
||||||
|
ToggleTransparency,
|
||||||
TransparencyAlpha(u8),
|
TransparencyAlpha(u8),
|
||||||
InvisibleBorders(Rect),
|
InvisibleBorders(Rect),
|
||||||
StackbarMode(StackbarMode),
|
StackbarMode(StackbarMode),
|
||||||
|
|||||||
@@ -1339,6 +1339,10 @@ impl WindowManager {
|
|||||||
SocketMessage::AnimationStyle(style) => {
|
SocketMessage::AnimationStyle(style) => {
|
||||||
*ANIMATION_STYLE.lock() = style;
|
*ANIMATION_STYLE.lock() = style;
|
||||||
}
|
}
|
||||||
|
SocketMessage::ToggleTransparency => {
|
||||||
|
let current = transparency_manager::TRANSPARENCY_ENABLED.load(Ordering::SeqCst);
|
||||||
|
transparency_manager::TRANSPARENCY_ENABLED.store(!current, Ordering::SeqCst);
|
||||||
|
}
|
||||||
SocketMessage::Transparency(enable) => {
|
SocketMessage::Transparency(enable) => {
|
||||||
transparency_manager::TRANSPARENCY_ENABLED.store(enable, Ordering::SeqCst);
|
transparency_manager::TRANSPARENCY_ENABLED.store(enable, Ordering::SeqCst);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1249,6 +1249,8 @@ enum SubCommand {
|
|||||||
/// Set the alpha value for unfocused window transparency
|
/// Set the alpha value for unfocused window transparency
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
TransparencyAlpha(TransparencyAlpha),
|
TransparencyAlpha(TransparencyAlpha),
|
||||||
|
/// Toggle transparency for unfocused windows
|
||||||
|
ToggleTransparency,
|
||||||
/// Enable or disable the window move animation
|
/// Enable or disable the window move animation
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
Animation(Animation),
|
Animation(Animation),
|
||||||
@@ -2328,6 +2330,9 @@ Stop-Process -Name:komorebi -ErrorAction SilentlyContinue
|
|||||||
SubCommand::TransparencyAlpha(arg) => {
|
SubCommand::TransparencyAlpha(arg) => {
|
||||||
send_message(&SocketMessage::TransparencyAlpha(arg.alpha))?;
|
send_message(&SocketMessage::TransparencyAlpha(arg.alpha))?;
|
||||||
}
|
}
|
||||||
|
SubCommand::ToggleTransparency => {
|
||||||
|
send_message(&SocketMessage::ToggleTransparency)?;
|
||||||
|
}
|
||||||
SubCommand::Animation(arg) => {
|
SubCommand::Animation(arg) => {
|
||||||
send_message(&SocketMessage::Animation(arg.boolean_state.into()))?;
|
send_message(&SocketMessage::Animation(arg.boolean_state.into()))?;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user