mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-26 11:21:20 +01: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:
@@ -3,9 +3,12 @@
|
||||
```
|
||||
Check komorebi configuration and related files for common errors
|
||||
|
||||
Usage: komorebic.exe check
|
||||
Usage: komorebic.exe check [OPTIONS]
|
||||
|
||||
Options:
|
||||
-k, --komorebi-config <KOMOREBI_CONFIG>
|
||||
Path to a static configuration JSON file
|
||||
|
||||
-h, --help
|
||||
Print help
|
||||
|
||||
|
||||
18
docs/cli/stackbar-mode.md
Normal file
18
docs/cli/stackbar-mode.md
Normal file
@@ -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,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Display, Serialize, Deserialize, JsonSchema)]
|
||||
#[derive(
|
||||
Debug, Copy, Clone, Eq, PartialEq, Display, Serialize, Deserialize, JsonSchema, ValueEnum,
|
||||
)]
|
||||
pub enum StackbarMode {
|
||||
Always,
|
||||
Never,
|
||||
|
||||
@@ -1662,6 +1662,7 @@ impl WindowManager {
|
||||
}
|
||||
SocketMessage::StackbarMode(mode) => {
|
||||
STACKBAR_MODE.store(mode);
|
||||
self.retile_all(true)?;
|
||||
}
|
||||
SocketMessage::StackbarLabel(label) => {
|
||||
STACKBAR_LABEL.store(label);
|
||||
|
||||
@@ -721,6 +721,13 @@ struct BorderImplementation {
|
||||
style: komorebi_client::BorderImplementation,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct StackbarMode {
|
||||
/// Desired stackbar mode
|
||||
#[clap(value_enum)]
|
||||
mode: komorebi_client::StackbarMode,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Animation {
|
||||
#[clap(value_enum)]
|
||||
@@ -1368,6 +1375,9 @@ enum SubCommand {
|
||||
/// Set the border implementation
|
||||
#[clap(arg_required_else_help = true)]
|
||||
BorderImplementation(BorderImplementation),
|
||||
/// Set the stackbar mode
|
||||
#[clap(arg_required_else_help = true)]
|
||||
StackbarMode(StackbarMode),
|
||||
/// Enable or disable transparency for unfocused windows
|
||||
#[clap(arg_required_else_help = true)]
|
||||
Transparency(Transparency),
|
||||
@@ -2785,6 +2795,9 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
|
||||
SubCommand::BorderImplementation(arg) => {
|
||||
send_message(&SocketMessage::BorderImplementation(arg.style))?;
|
||||
}
|
||||
SubCommand::StackbarMode(arg) => {
|
||||
send_message(&SocketMessage::StackbarMode(arg.mode))?;
|
||||
}
|
||||
SubCommand::Transparency(arg) => {
|
||||
send_message(&SocketMessage::Transparency(arg.boolean_state.into()))?;
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@ nav:
|
||||
- cli/border-offset.md
|
||||
- cli/border-style.md
|
||||
- cli/border-implementation.md
|
||||
- cli/stackbar-mode.md
|
||||
- cli/transparency.md
|
||||
- cli/transparency-alpha.md
|
||||
- cli/toggle-transparency.md
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"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",
|
||||
"required": [
|
||||
"left_widgets",
|
||||
|
||||
11
schema.json
11
schema.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"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",
|
||||
"properties": {
|
||||
"animation": {
|
||||
@@ -1227,6 +1227,15 @@
|
||||
"RightMainVerticalStack"
|
||||
]
|
||||
},
|
||||
"layout_flip": {
|
||||
"description": "Specify an axis on which to flip the selected layout (default: None)",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Horizontal",
|
||||
"Vertical",
|
||||
"HorizontalAndVertical"
|
||||
]
|
||||
},
|
||||
"layout_rules": {
|
||||
"description": "Layout rules (default: None)",
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user