A CLI tool for managing windows and workspaces on the COSMIC Desktop Environment (Wayland).
Note: This is a third-party, unofficial tool. It is not affiliated with System76 or the official COSMIC project.
- List Information: View active applications, workspaces, and outputs.
- Window Management: Move applications between workspaces by their App ID.
- Activate Application: Bring a specific application to the foreground.
- Smart Wait: Option to wait for an application to launch before moving it.
Ensure you have the Rust toolchain installed.
cargo build --releaseor from github directly
cargo install --git https://github.com/estin/cos-clicos-cli [COMMAND]List all available apps, workspaces, outputs and seats, including the state of each app window.
cos-cli infoExample output:
Apps: [0] firefox (title: Gemini - Mozilla Firefox, state: [activated]) [1] org.wezfurlong.wezterm (title: cos-cli, state: [maximized]) Workspaces: [0] Group Workspace: 1 Workspace: 2 Workspace: 3 Outputs: [0] Output: eDP-1 Seats: [0] Seat: seat0 With --json option it will output all info in JSON format.
cos-cli info --jsonExample output:
{"apps":[{"index":0,"app_id":"firefox","title":"Gemini - Mozilla Firefox","state":["activated"]},{"index":1,"app_id":"org.wezfurlong.wezterm","title":"cos-cli","state":["maximized"]}],"workspaces":[{"index":0,"workspaces":[{"name":"1"},{"name":"2"},{"name":"3"}]}],"outputs":[{"index":0,"name":"eDP-1"}],"seats":[{"index":0,"name":"seat0"}]}Using jq to find app index by pattern and activate app
cos-cli activate -i $(cos-cli info --json | jq '.apps[] | select(.app_id | test("wezterm")) | .index')Move an application to a specific workspace.
cos-cli move --app-id <ID> --workspace <NAME>Arguments:
-a, --app-id <ID>The Application ID (partial match, case-insensitive)-i, --index <INDEX>The Application index from 'info' command-w, --workspace <NAME>The name of the target workspace-g, --workspace-group <INDEX>The workspace group index from 'info' command (optional)-o, --output-index <INDEX>The output index from 'info' command (optional)--wait <SECONDS>Wait for the app to appear (optional, only for --app-id)
Activate an application.
cos-cli activate --index <INDEX>Arguments:
-i, --index <INDEX>The Application index from 'info' command-s, --seat <INDEX>The Seat index from 'info' command (optional)
Set the state of an application's window (e.g., maximize, minimize, fullscreen, sticky).
cos-cli state (--app-id <ID> | --index <INDEX>) [--wait <SECONDS>] [--maximize|--unmaximize] [--minimize|--unminimize] [--fullscreen|--unfullscreen] [--sticky|--unsticky]Arguments:
-a, --app-id <ID>The Application ID (partial match, case-insensitive)-i, --index <INDEX>The Application index from 'info' command--wait <SECONDS>Wait for the app to appear (optional, only for --app-id)--maximizeMaximize the application window--unmaximizeUnmaximize the application window--minimizeMinimize the application window--unminimizeUnminimize the application window--fullscreenSet the application window to fullscreen--unfullscreenUnset the application window from fullscreen--stickyMake the application window sticky (visible on all workspaces)--unstickyUnset the application window from being sticky
Examples:
cos-cli state -i 0 --maximize cos-cli state --app-id firefox --sticky --fullscreen --wait 5 cos-cli state -i 1 --unminimize