xdi/README.md
2026-08-24 22:51:37 +05:30

1.4 KiB

xdi

Minimal X11 desktop information utility.

Prints desktop and window information as JSON.

Install

cargo install --git https://git.candifloss.cc/candifloss/xdi.git

Usage

Print the current state:

xdi

Example output:

{
  "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:

xdi --follow

Or:

xdi -f

In follow mode, xdi prints a new JSON object whenever the desktop state changes.

Requirements

  • X11
  • An EWMH compatible window manager