mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-11 23:52:47 +02:00
feat(cli): add stackbar-mode command
This commit adds a new komorebic command "stackbar-mode" to allow users to change stackbar modes programmatically.
This commit is contained in:
+4
-1
@@ -3,9 +3,12 @@
|
|||||||
```
|
```
|
||||||
Check komorebi configuration and related files for common errors
|
Check komorebi configuration and related files for common errors
|
||||||
|
|
||||||
Usage: komorebic.exe check
|
Usage: komorebic.exe check [OPTIONS]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
-k, --komorebi-config <KOMOREBI_CONFIG>
|
||||||
|
Path to a static configuration JSON file
|
||||||
|
|
||||||
-h, --help
|
-h, --help
|
||||||
Print help
|
Print help
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# stackbar-mode
|
||||||
|
|
||||||
|
```
|
||||||
|
Set the stackbar mode
|
||||||
|
|
||||||
|
Usage: komorebic.exe stackbar-mode <MODE>
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
<MODE>
|
||||||
|
Desired stackbar mode
|
||||||
|
|
||||||
|
[possible values: always, never, on-stack]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help
|
||||||
|
Print help
|
||||||
|
|
||||||
|
```
|
||||||
@@ -238,7 +238,9 @@ pub struct SubscribeOptions {
|
|||||||
pub filter_state_changes: bool,
|
pub filter_state_changes: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Display, Serialize, Deserialize, JsonSchema)]
|
#[derive(
|
||||||
|
Debug, Copy, Clone, Eq, PartialEq, Display, Serialize, Deserialize, JsonSchema, ValueEnum,
|
||||||
|
)]
|
||||||
pub enum StackbarMode {
|
pub enum StackbarMode {
|
||||||
Always,
|
Always,
|
||||||
Never,
|
Never,
|
||||||
|
|||||||
@@ -1662,6 +1662,7 @@ impl WindowManager {
|
|||||||
}
|
}
|
||||||
SocketMessage::StackbarMode(mode) => {
|
SocketMessage::StackbarMode(mode) => {
|
||||||
STACKBAR_MODE.store(mode);
|
STACKBAR_MODE.store(mode);
|
||||||
|
self.retile_all(true)?;
|
||||||
}
|
}
|
||||||
SocketMessage::StackbarLabel(label) => {
|
SocketMessage::StackbarLabel(label) => {
|
||||||
STACKBAR_LABEL.store(label);
|
STACKBAR_LABEL.store(label);
|
||||||
|
|||||||
@@ -721,6 +721,13 @@ struct BorderImplementation {
|
|||||||
style: komorebi_client::BorderImplementation,
|
style: komorebi_client::BorderImplementation,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Parser)]
|
||||||
|
struct StackbarMode {
|
||||||
|
/// Desired stackbar mode
|
||||||
|
#[clap(value_enum)]
|
||||||
|
mode: komorebi_client::StackbarMode,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
struct Animation {
|
struct Animation {
|
||||||
#[clap(value_enum)]
|
#[clap(value_enum)]
|
||||||
@@ -1368,6 +1375,9 @@ enum SubCommand {
|
|||||||
/// Set the border implementation
|
/// Set the border implementation
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
BorderImplementation(BorderImplementation),
|
BorderImplementation(BorderImplementation),
|
||||||
|
/// Set the stackbar mode
|
||||||
|
#[clap(arg_required_else_help = true)]
|
||||||
|
StackbarMode(StackbarMode),
|
||||||
/// Enable or disable transparency for unfocused windows
|
/// Enable or disable transparency for unfocused windows
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
Transparency(Transparency),
|
Transparency(Transparency),
|
||||||
@@ -2785,6 +2795,9 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
|
|||||||
SubCommand::BorderImplementation(arg) => {
|
SubCommand::BorderImplementation(arg) => {
|
||||||
send_message(&SocketMessage::BorderImplementation(arg.style))?;
|
send_message(&SocketMessage::BorderImplementation(arg.style))?;
|
||||||
}
|
}
|
||||||
|
SubCommand::StackbarMode(arg) => {
|
||||||
|
send_message(&SocketMessage::StackbarMode(arg.mode))?;
|
||||||
|
}
|
||||||
SubCommand::Transparency(arg) => {
|
SubCommand::Transparency(arg) => {
|
||||||
send_message(&SocketMessage::Transparency(arg.boolean_state.into()))?;
|
send_message(&SocketMessage::Transparency(arg.boolean_state.into()))?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ nav:
|
|||||||
- cli/border-offset.md
|
- cli/border-offset.md
|
||||||
- cli/border-style.md
|
- cli/border-style.md
|
||||||
- cli/border-implementation.md
|
- cli/border-implementation.md
|
||||||
|
- cli/stackbar-mode.md
|
||||||
- cli/transparency.md
|
- cli/transparency.md
|
||||||
- cli/transparency-alpha.md
|
- cli/transparency-alpha.md
|
||||||
- cli/toggle-transparency.md
|
- cli/toggle-transparency.md
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "KomobarConfig",
|
"title": "KomobarConfig",
|
||||||
"description": "The `komorebi.bar.json` configuration file reference for `v0.1.32`",
|
"description": "The `komorebi.bar.json` configuration file reference for `v0.1.33`",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"left_widgets",
|
"left_widgets",
|
||||||
|
|||||||
+10
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "StaticConfig",
|
"title": "StaticConfig",
|
||||||
"description": "The `komorebi.json` static configuration file reference for `v0.1.32`",
|
"description": "The `komorebi.json` static configuration file reference for `v0.1.33`",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"animation": {
|
"animation": {
|
||||||
@@ -1227,6 +1227,15 @@
|
|||||||
"RightMainVerticalStack"
|
"RightMainVerticalStack"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"layout_flip": {
|
||||||
|
"description": "Specify an axis on which to flip the selected layout (default: None)",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Horizontal",
|
||||||
|
"Vertical",
|
||||||
|
"HorizontalAndVertical"
|
||||||
|
]
|
||||||
|
},
|
||||||
"layout_rules": {
|
"layout_rules": {
|
||||||
"description": "Layout rules (default: None)",
|
"description": "Layout rules (default: None)",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|||||||
Reference in New Issue
Block a user