Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.3.5 — 2026-09-01

- Interpret the ChatGPT desktop version date segment (`YY.MDD`) for the
launch-button tooltip, with the local package/update date as a fallback for
versions that do not match the observed format.

## 0.3.4 — 2026-09-01

- Derive the ChatGPT launch-button date dynamically from the installed
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@
native expandable section, which opens automatically after recent activity.
- Launches an installed ChatGPT desktop app or Codex CLI directly, with native
installation guidance when either is missing. Web shortcuts cover ChatGPT,
Codex Cloud and ChatGPT Analytics. The ChatGPT launch tooltip derives its
displayed date from the installed executable's local package/update timestamp;
this is not an upstream publication-date guarantee.
Codex Cloud and ChatGPT Analytics. The ChatGPT launch tooltip interprets the
observed date segment in the desktop version (`YY.MDD`) and falls back to the
installed executable's local package/update timestamp when that format is
unavailable; neither is an upstream publication-date guarantee.
- Shows `5h` automatically only when an active API limit exposes that window;
an accompanying `7d` panel block can be hidden in settings while unnamed
internal buckets stay hidden.
Expand All @@ -94,7 +95,7 @@ cd cinnamon-chatgpt-usage
Then open **System Settings → Applets** and add **ChatGPT Usage** to a panel.
Requirements: Cinnamon 5.8+, Python 3 and a current
[Codex CLI](https://learn.chatgpt.com/docs/codex/cli#getting-started) signed in
with ChatGPT. Version 0.3.4 is tested on Cinnamon 6.6.9 with Codex CLI 0.152.0.
with ChatGPT. Version 0.3.5 is tested on Cinnamon 6.6.9 with Codex CLI 0.152.0.

Run `./install.sh` again after updates. `./uninstall.sh` removes the applet while
retaining its settings.
Expand Down
3 changes: 2 additions & 1 deletion applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ class ChatGptUsageApplet extends Applet.Applet {
const codexPath = this._resolveCodexPath();
const codexCommand = this._codexTerminalCommand(codexPath);
const chatGptVersion = this._chatGptAppVersion(chatGptApp);
const chatGptVersionDate = UsageFormat.formatChatGptVersionDate(chatGptVersion);
const chatGptInstallDate = this._chatGptAppInstallDate(chatGptApp);
const codexVersion = this._commandVersion(codexPath);
const item = new PopupMenu.PopupBaseMenuItem({
Expand Down Expand Up @@ -1110,7 +1111,7 @@ class ChatGptUsageApplet extends Applet.Applet {
Boolean(chatGptApp),
chatGptVersion,
"chatgpt",
chatGptInstallDate
chatGptVersionDate || chatGptInstallDate
)
);
this._codexButton = this._createLaunchButton(
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A tiny Cinnamon companion that keeps ChatGPT Work and Codex usage beautifully in view.",
"comments": "Made with love by Claudiu & Codex. 🩷\n\nhttps://github.com/oss-singularity/cinnamon-chatgpt-usage",
"contributors": "OSS Singularity — open-source home of the project,Claudiu Schuster — creator and maintainer,OpenAI Codex — design and engineering collaborator",
"version": "0.3.4",
"version": "0.3.5",
"author": "OSS Singularity",
"max-instances": 1,
"cinnamon-version": ["5.8", "6.0", "6.2", "6.4", "6.6"],
Expand Down
25 changes: 25 additions & 0 deletions tests/test-usage-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,31 @@ assertEqual(
null,
"Invalid application package timestamp has no date"
);
assertEqual(
UsageFormat.formatChatGptVersionDate("26.831.20005"),
"31.08.2026",
"ChatGPT version date decodes August 31, 2026"
);
assertEqual(
UsageFormat.formatChatGptVersionDate("26.825.51511"),
"25.08.2026",
"ChatGPT version date decodes August 25, 2026"
);
assertEqual(
UsageFormat.formatChatGptVersionDate("26.406.40811"),
"06.04.2026",
"ChatGPT version date decodes April 6, 2026"
);
assertEqual(
UsageFormat.formatChatGptVersionDate("26.1001.20005"),
"01.10.2026",
"ChatGPT version date supports two-digit months"
);
assertEqual(
UsageFormat.formatChatGptVersionDate("new-version"),
null,
"Unknown ChatGPT version has no decoded build date"
);
assertEqual(
UsageFormat.formatAppTooltip(true, "codex-cli 0.152.0", "", "01.09.2026"),
"codex-cli 0.152.0 — 01.09.2026",
Expand Down
22 changes: 22 additions & 0 deletions usage-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,27 @@ function formatLocalDate(epochSeconds) {
return dateTime.format("%d.%m.%Y");
}

function formatChatGptVersionDate(version) {
const match = String(version || "").trim().match(/^(\d{2})\.(\d{3,4})\.\d{5}$/);
if (!match) return null;

const year = 2000 + Number(match[1]);
const dateCode = match[2];
const month = Number(dateCode.slice(0, -2));
const day = Number(dateCode.slice(-2));
const date = new Date(Date.UTC(year, month - 1, day));
if (
month < 1 || month > 12 || day < 1 ||
date.getUTCFullYear() !== year ||
date.getUTCMonth() !== month - 1 ||
date.getUTCDate() !== day
) {
return null;
}

return `${String(day).padStart(2, "0")}.${String(month).padStart(2, "0")}.${year}`;
}

function formatRelativeTime(epochSeconds, nowSeconds = null) {
const updatedSeconds = Number(epochSeconds);
const currentSeconds = nowSeconds === null
Expand Down Expand Up @@ -581,6 +602,7 @@ module.exports = {
formatAccessibleTooltip,
formatTimestamp,
formatLocalDate,
formatChatGptVersionDate,
formatRelativeTime,
formatAppTooltip
};