feat: expose layout controls over IPC

This commit is contained in:
Samuel Onoja committed 2026-09-25 04:15:48 +01:00
1 parent 0a98bead56
commit d0dc55349c
4 files changed
+18 -4

No files matched your search

+7 -2
View File
@@ -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]