git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit12f3baae2ccfeedd1bfe60a482d3a0e089ebbde4
parentfcf1a0a0b8
authorLucas Galante <[email protected]>
date2026-07-07 11:50
refactor: split control CLI into a dedicated ccectl binary

Move IPC control out of the cce binary's `control`/cce-ctl subcommand into a
standalone `ccectl` binary. Install it in the Makefile and point the desktop/app
menu scripts at ccectl instead of cce-ctl.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

 Makefile                 |  6 +++++-
 scripts/cce-app-menu     |  2 +-
 scripts/cce-desktop-menu |  2 +-
 src/bin/cce.rs           | 18 +-----------------
 src/bin/ccectl.rs        |  4 ++++
 5 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index b467b97..af0d77c 100644
--- a/Makefile
+++ b/Makefile
@@ -8,10 +8,14 @@ install: build
 	@if [ -f ../target/release/cce-fx ]; then \
 		install -m 755 ../target/release/cce-fx ~/.local/bin/cce-fx; \
 		ln -sf cce-fx ~/.local/bin/cce; \
-		ln -sf cce-fx ~/.local/bin/cce-ctl; \
 	else \
 		echo "Error: cce-fx binary not found"; exit 1; \
 	fi
+	@if [ -f ../target/release/ccectl ]; then \
+		install -m 755 ../target/release/ccectl ~/.local/bin/ccectl; \
+	else \
+		echo "Error: ccectl binary not found"; exit 1; \
+	fi
 	install -m 755 scripts/cce-desktop-menu ~/.local/bin/cce-desktop-menu
 	install -m 755 scripts/cce-app-menu ~/.local/bin/cce-app-menu
 	install -m 755 scripts/gpu-watcher ~/.local/bin/gpu-watcher
diff --git a/scripts/cce-app-menu b/scripts/cce-app-menu
index 504e4ca..0aa7808 100644
--- a/scripts/cce-app-menu
+++ b/scripts/cce-app-menu
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 # cce-app-menu — Context menu for CCE application windows
 
-CCE_CTL="/home/lsgalante/.local/bin/cce-ctl"
+CCE_CTL="/home/lsgalante/.local/bin/ccectl"
 CLEAR_CLOUD="/home/lsgalante/.local/bin/cce-cloud"
 
 # Default to empty/none
diff --git a/scripts/cce-desktop-menu b/scripts/cce-desktop-menu
index e2026d0..82bad24 100644
--- a/scripts/cce-desktop-menu
+++ b/scripts/cce-desktop-menu
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 # cce-desktop-menu — Context menu for CCE desktop background
 
-CCE_CTL="/home/lsgalante/.local/bin/cce-ctl"
+CCE_CTL="/home/lsgalante/.local/bin/ccectl"
 CLEAR_CLOUD="/home/lsgalante/.local/bin/cce-cloud"
 
 # Default to empty coordinates if not provided
diff --git a/src/bin/cce.rs b/src/bin/cce.rs
index e3b9f3c..58bcde7 100644
--- a/src/bin/cce.rs
+++ b/src/bin/cce.rs
@@ -2,15 +2,6 @@ use std::env;
 
 fn main() {
     let args: Vec<String> = env::args().collect();
-    let program_name = args.get(0)
-        .and_then(|s| std::path::Path::new(s).file_name())
-        .map(|n| n.to_string_lossy().into_owned())
-        .unwrap_or_default();
-
-    if program_name == "cce-ctl" {
-        cce_fx::run_cce_ctl(args);
-        return;
-    }
 
     if args.len() > 1 {
         match args[1].as_str() {
@@ -18,11 +9,6 @@ fn main() {
                 println!("cce: standalone client mode is deprecated in the monolithic architecture");
                 std::process::exit(0);
             }
-            "control" => {
-                let mut control_args = vec!["cce-ctl".to_string()];
-                control_args.extend(args.iter().skip(2).cloned());
-                cce_fx::run_cce_ctl(control_args);
-            }
             "--help" | "-h" | "help" => {
                 print_help();
             }
@@ -36,9 +22,7 @@ fn main() {
 }
 
 fn print_help() {
-    println!("usage: cce <subcommand> [options]");
+    println!("usage: cce [options]");
     println!();
-    println!("subcommands:");
     println!("  (default)          Start the monolithic compositor and window manager");
-    println!("  control            Run IPC control commands (e.g. cce control layout gap 10)");
 }
diff --git a/src/bin/ccectl.rs b/src/bin/ccectl.rs
new file mode 100644
index 0000000..61eab3f
--- /dev/null
+++ b/src/bin/ccectl.rs
@@ -0,0 +1,4 @@
+fn main() {
+    let args: Vec<String> = std::env::args().collect();
+    cce_fx::run_cce_ctl(args);
+}