ocdway/config/waybar-config.jsonc
ocpway ea834a99a5 Initial commit: ocd waybar plugin
Daemon (scripts/ocd-waybar) polls {
  "schema_version": 1,
  "generated_at": "2026-07-30T01:29:37.918330160+00:00",
  "accounts": [
    {
      "account": "legal",
      "workspace": "wrk_01KBJFEAZV7G2FJBE1KAPRQSJN",
      "fetched_at": "2026-07-30T01:27:49.014903087+00:00",
      "status": "cached",
      "limits": {
        "usage_5h": {
          "used": 0.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-07-30T06:27:49.014903087+00:00",
          "status": "ok"
        },
        "usage_week": {
          "used": 88.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-03T00:00:01.014903087+00:00",
          "status": "ok"
        },
        "usage_month": {
          "used": 94.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-21T22:07:23.014903087+00:00",
          "status": "ok"
        },
        "next_update": null
      },
      "balance": {
        "remaining": 0.0,
        "unit": "$"
      }
    },
    {
      "account": "legal2",
      "workspace": "wrk_01KQHV4ZP2SHZHTCTF0HW1BKHA",
      "fetched_at": "2026-07-30T01:27:49.920803926+00:00",
      "status": "cached",
      "limits": {
        "usage_5h": {
          "used": 0.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-07-30T06:27:49.920803926+00:00",
          "status": "ok"
        },
        "usage_week": {
          "used": 100.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-03T00:00:00.920803926+00:00",
          "status": "rate-limited"
        },
        "usage_month": {
          "used": 90.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-23T18:01:33.920803926+00:00",
          "status": "ok"
        },
        "next_update": null
      },
      "balance": {
        "remaining": 0.0,
        "unit": "$"
      }
    },
    {
      "account": "kllr560",
      "workspace": "wrk_01KYJ5B4PM2EGR16ZDC0JTH2CC",
      "fetched_at": "2026-07-30T01:27:50.791975864+00:00",
      "status": "cached",
      "limits": {
        "usage_5h": {
          "used": 0.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-07-30T06:27:50.791975864+00:00",
          "status": "ok"
        },
        "usage_week": {
          "used": 79.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-03T00:00:00.791975864+00:00",
          "status": "ok"
        },
        "usage_month": {
          "used": 39.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-27T16:10:15.791975864+00:00",
          "status": "ok"
        },
        "next_update": null
      },
      "balance": {
        "remaining": 0.0,
        "unit": "$"
      }
    },
    {
      "account": "pj-vendee",
      "workspace": "wrk_01KYNGQCX4XEM0KD3PWVVE636D",
      "fetched_at": "2026-07-30T01:27:51.638144968+00:00",
      "status": "cached",
      "limits": {
        "usage_5h": {
          "used": 0.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-07-30T06:27:51.638144968+00:00",
          "status": "ok"
        },
        "usage_week": {
          "used": 40.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-03T00:00:00.638144968+00:00",
          "status": "ok"
        },
        "usage_month": {
          "used": 20.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-29T01:09:27.638144968+00:00",
          "status": "ok"
        },
        "next_update": null
      },
      "balance": {
        "remaining": 0.0,
        "unit": "$"
      }
    },
    {
      "account": "iyaunalunarovell",
      "workspace": "wrk_01KYNTSGXF7GFXMAMT36N3GH21",
      "fetched_at": "2026-07-30T01:27:52.584601387+00:00",
      "status": "cached",
      "limits": {
        "usage_5h": {
          "used": 94.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-07-30T02:27:25.584601387+00:00",
          "status": "ok"
        },
        "usage_week": {
          "used": 99.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-03T00:00:00.584601387+00:00",
          "status": "ok"
        },
        "usage_month": {
          "used": 49.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-29T02:22:06.584601387+00:00",
          "status": "ok"
        },
        "next_update": null
      },
      "balance": {
        "remaining": 0.0,
        "unit": "$"
      }
    },
    {
      "account": "balensiefenpiwihu2906",
      "workspace": "wrk_01KYQNFP718WP7X9W7RXC2Q133",
      "fetched_at": "2026-07-30T01:27:53.457572405+00:00",
      "status": "cached",
      "limits": {
        "usage_5h": {
          "used": 53.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-07-30T03:43:22.457572405+00:00",
          "status": "ok"
        },
        "usage_week": {
          "used": 21.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-03T00:00:00.457572405+00:00",
          "status": "ok"
        },
        "usage_month": {
          "used": 10.0,
          "total": 100.0,
          "unit": "%",
          "resets_at": "2026-08-29T19:27:31.457572405+00:00",
          "status": "ok"
        },
        "next_update": null
      },
      "balance": {
        "remaining": 0.0,
        "unit": "$"
      }
    }
  ]
} every 30s (no force
flags, so ocd cache/TTL stays in charge), runs a 5s account rotation
in config order, and supports right-click 1h lock. The waybar
custom/ocd module reads a state.json written by the daemon; hover
shows all accounts via the native tooltip. Bars are Pango background
spans (~50px) in the label and plain block chars in the tooltip, since
waybar 0.15.0 renders custom tooltips as plain text.
2026-07-30 04:29:37 +03:00

27 lines
832 B
Plaintext

// Snippet to add to ~/.config/waybar/config.jsonc
//
// 1. Add "custom/ocd" to the "modules-right" (or modules-left/center) array:
//
// "modules-right": [
// "custom/lang",
// "custom/ocd", // <- add this
// "group/tray-expander",
// "network",
// "pulseaudio",
// "cpu",
// "memory",
// "clock",
// ],
//
// 2. Add the module block below anywhere in the top-level object:
"custom/ocd": {
"exec": "cat $HOME/.local/state/ocd-waybar/state.json",
"exec-if": "test -f $HOME/.local/state/ocd-waybar/state.json",
"return-type": "json",
"interval": 1,
"format": "{}",
"tooltip-format": "{}",
"on-click": "~/.config/waybar/scripts/ocd-waybar-ctl advance",
"on-click-right": "~/.config/waybar/scripts/ocd-waybar-ctl lock"
},