diff --git a/README.md b/README.md index 06f5dd3..1af4334 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,89 @@ # xdi -X11 Desktop Info \ No newline at end of file +Minimal X11 desktop information utility. + +Prints desktop and window information as JSON. + +## Install + +```bash +cargo install --git https://git.candifloss.cc/candifloss/xdi.git +``` + +## Usage + +Print the current state: + +```bash +xdi +``` + +Example output: + +```json +{ + "active_window": { + "id": 73400324, + "name": "Preview README.md - xdi - Code - OSS", + "class": "code-oss" + }, + "workspaces": [ + { + "id": 0, + "current": true, + "windows": [ + { + "id": 35651587, + "name": "~/Projects", + "class": "Alacritty" + }, + { + "id": 73400324, + "name": "Preview README.md - xdi - Code - OSS", + "class": "code-oss" + }, + { + "id": 90177540, + "name": "Rust CLI Apps - Rust X11 Workspace Tool - Chromium", + "class": "Chromium-browser" + }, + { + "id": 104857698, + "name": "JsonPretty - JSON Beautifier and Formatter — Mozilla Firefox", + "class": "firefox" + } + ] + }, + { + "id": 1, + "current": false, + "windows": [ + { + "id": 106954755, + "name": "~/P/x/src", + "class": "Alacritty" + } + ] + } + ] +} +``` + +Follow desktop changes: + +```bash +xdi --follow +``` + +Or: + +```bash +xdi -f +``` + +In follow mode, `xdi` prints a new JSON object whenever the desktop state changes. + +## Requirements + +- X11 +- An EWMH compatible window manager