Skip to content

calendarium@kami911: timezone fixes, auto-detected location, customizable border, French Republican calendar - #1895

Open
KAMI911 wants to merge 12 commits into
linuxmint:masterfrom
KAMI911:calendarium-upstream-pr
Open

calendarium@kami911: timezone fixes, auto-detected location, customizable border, French Republican calendar#1895
KAMI911 wants to merge 12 commits into
linuxmint:masterfrom
KAMI911:calendarium-upstream-pr

Conversation

@KAMI911

@KAMI911 KAMI911 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Alternate calendars

  • Add French Republican calendar (equinox-based) as an option under Alternate Calendars — each Republican year begins at the true autumnal equinox, so the 5/6 intercalary days fall out naturally instead of from a fixed leap-year formula

Location & timezone

  • Fix geocoder lookups to save the canonical city name back to the city name field
  • Fix primary-location sunrise/sunset and moonrise/moonset times being rendered in the computer's timezone even when the location is elsewhere: add a primary-tz IANA timezone setting, auto-filled by the city search alongside latitude/longitude (empty = use the system timezone)
  • When "Use manual location" is off, detect the location automatically from the computer's system IANA timezone (resolved asynchronously via GLib.TimeZone, /etc/timezone or the /etc/localtime symlink, then looked up in tzdata's zone1970.tab/zone.tab), instead of hard-coding Budapest — Budapest remains the fallback
  • Add an optional "Show the clock and date in the primary location's timezone" toggle (off by default); when on, the main clock, date, month name and date-based calendar sections follow the primary location's timezone instead of the computer's

Appearance

  • Add an optional customizable border around the desklet: toggle, width 1–10 px, color, and corner radius 0–40 px; off by default
  • Move the Appearance settings (icon size, text scale, background opacity, border) onto their own settings page

Zodiac icons

  • Change the Metal element symbol to a shield (U+1F6E1) for better readability
  • Use a locale-aware globe emoji (🌍/🌎/🌏) for the Earth element based on the system locale

Translations

  • Clean up leftover merge markers and duplicated text in the Hungarian (hu.po) translation
  • Add English (.pot) and Hungarian strings for the new settings

KAMI911 and others added 8 commits August 25, 2026 11:31
_onCityNameChanged() looked up the typed city name via Geocoder.search()
and saved the match's lat/lon/tz, but never wrote the canonical,
correctly-capitalized name (e.g. "london" -> "London") back to the
city-name setting itself — so the displayed label kept whatever casing
the user originally typed. Found while porting this same logic to a
Firefox extension version of Calendarium and fixing it there first.
…Alternate Calendars

Ported from the Firefox extension version of Calendarium, where this was
researched and implemented first: Year 1 began at the true autumnal
equinox of 22 September 1792, and each subsequent Republican year begins
at the *next* true autumnal equinox — not a fixed arithmetic leap-year
rule (the later "Romme method" some software uses instead). Whether a
given Republican year has 5 or 6 intercalary Sansculottide days falls
out naturally from the actual gap between two real consecutive equinoxes
(365 or 366 days), which is why this builds on lib/solstice.js's
existing Meeus-algorithm equinox calculation rather than an arithmetic
approximation.

New setting "show-french-republican" under Alternate Calendars, wired
into desklet.js's settings binding and _updateAltCal(), with lib/
calendars.js gaining toFrenchRepublican()/formatFrenchRepublican()
alongside the existing Julian/Hebrew/Islamic/Persian converters.
Translations added to all 5 existing .po files plus the .pot template.
Verified numerically against known reference dates (the 22 Sept 1792
epoch, and the 1794->1795 sextile/leap year's extra "Jour de la
Révolution" day) before committing.
… times

The primary-location sunrise/sunset and moonrise/moonset calculations
called Sun.getSunTimes()/getMoonTimes() without a UTC offset, so they
were always rendered in the computer's system timezone even when the
primary location sits in a different one (e.g. Marmaris, Turkey on a
CET machine).

Add a "primary-tz" IANA timezone setting, populated automatically by the
city search (alongside latitude/longitude) just like the additional
cities. When set, its current UTC offset is passed to the Sun/Moon
calculations; when empty the behaviour is unchanged and the system
timezone is used.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
…imezone

When "Use manual location" is off, the desklet no longer hard-codes
Budapest. It resolves the computer's system IANA timezone (via
GLib.TimeZone, /etc/timezone or the /etc/localtime symlink) and looks up
approximate coordinates for it in tzdata's zone1970.tab / zone.tab.
Budapest remains the fallback when the timezone cannot be resolved.

The settings panel wording is updated accordingly, and the result is
cached for the desklet's lifetime.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
New Appearance settings: "Draw a border around the desklet" with
adjustable width (1–10 px), color (colorchooser) and corner radius
(0–40 px). Off by default; when enabled the border and radius are applied
to the container style alongside the existing background/opacity styling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Most findings
are advisory and do not automatically disqualify a pull request.

This check is not perfect and will not replace a normal review.


Found 3 potential issue(s):

⚠️ WARNING

⚠️ sync_file_get_contents

calendarium@kami911/files/calendarium@kami911/desklet.js:351

let [ok, contents] = GLib.file_get_contents("/etc/timezone");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

calendarium@kami911/files/calendarium@kami911/desklet.js:397

let [ok, contents] = GLib.file_get_contents(paths[p]);

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

⚠️ sync_file_query_info

calendarium@kami911/files/calendarium@kami911/desklet.js:361

.query_info("standard::symlink-target",

Synchronous query_info() blocks the main loop.
Use query_info_async() instead.


Automated pattern check.

@KAMI911 KAMI911 changed the title calendarium@kami911: French Republican calendar, geocoder fix, icon tweaks calendarium@kami911: timezone fixes, auto-detected location, customizable border, French Republican calendar Sep 2, 2026
KAMI911 and others added 4 commits September 2, 2026 22:26
Address the best-practices scanner warnings on PR linuxmint#1895: the system
timezone / coordinate lookup used synchronous GLib.file_get_contents()
and Gio query_info(), which block the main loop.

Replace them with Gio.File.load_contents_async() and
query_info_async(). The lookup now runs once at startup via
_resolveSystemLocationAsync(); until it completes _systemLocation()
returns the Budapest default, and a redraw is triggered when the real
result arrives (only when the primary location is auto-detected).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
…zone

Add a "Show the clock and date in the primary location's timezone"
checkbox (Location section, off by default). When enabled, the main
clock, date label, month name and the date-based calendar sections use
the primary location's timezone (the primary-tz setting, or the
auto-detected system timezone) instead of the computer's own time.

Default behaviour is unchanged: the clock follows the computer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
The Appearance section (icon size, text scale, background opacity,
border) was the last section on the crowded General page. Give it a
dedicated "Appearance" settings page, between Location and Wikipedia.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant