feat: expose layout controls over IPC
This commit is contained in:
1 parent
0a98bead56
commit
d0dc55349c
4 files changed
+18
-4
No files matched your search
@@ -47,7 +47,8 @@ fn parse_args(args: impl IntoIterator<Item = String>) -> Result<(String, Value),
|
||||
.map_err(|_| format!("{} requires a positive workspace index", command))?;
|
||||
json!({ "index": index })
|
||||
}
|
||||
"toggle-floating" | "toggle-fullscreen" | "close" | "get-focused-window"
|
||||
"toggle-floating" | "toggle-fullscreen" | "toggle-layout" | "cycle-column-width"
|
||||
| "center-column" | "consume" | "expel" | "close" | "get-focused-window"
|
||||
| "get-workspaces" | "get-outputs" => {
|
||||
if !positional.is_empty() {
|
||||
return Err(format!("{command} does not accept arguments"));
|
||||
@@ -77,7 +78,7 @@ fn socket_path() -> Result<PathBuf, io::Error> {
|
||||
}
|
||||
|
||||
fn usage() -> String {
|
||||
"usage: feresectl <focus|move|resize> <direction>\n feresectl <workspace|move-to-workspace> <index>\n feresectl <toggle-floating|toggle-fullscreen|close|get-focused-window|get-workspaces|get-outputs>".to_owned()
|
||||
"usage: feresectl <focus|move|resize> <direction>\n feresectl <workspace|move-to-workspace> <index>\n feresectl <toggle-floating|toggle-fullscreen|toggle-layout>\n feresectl <cycle-column-width|center-column|consume|expel|close>\n feresectl <get-focused-window|get-workspaces|get-outputs>".to_owned()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -98,6 +99,10 @@ mod tests {
|
||||
.1,
|
||||
json!({ "index": 7 })
|
||||
);
|
||||
assert_eq!(
|
||||
parse_args(["cycle-column-width".to_owned()]).unwrap(),
|
||||
("cycle-column-width".to_owned(), json!({}))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user