Skip to content

v0.2.2

Choose a tag to compare

@rizukirr rizukirr released this 12 May 12:28

Muslimtify v0.2.2

Bugfix + UX release focused on the timezone and location pipeline.
Closes #11.


Highlights

Timezone overhaul (fixes #11)

  • System tzdb for offsets.
    Replaced the hardcoded ~20-entry IANA table (which silently returned UTC+0 for unknown zones and ignored DST entirely) with:

    • libc tzdb on Linux (setenv TZ + tzset + tm_gmtoff, with TZ save/restore)
    • Win32 implementation on Windows (42-entry CLDR-derived IANA → Windows table + EnumDynamicTimeZoneInformation + SystemTimeToTzSpecificLocalTimeEx for DST-aware offsets)

    (6d486bc, dd2f8b1)

  • get_system_timezone helper for both platforms:

    • Linux reads /etc/localtime (with /etc/timezone fallback, UTC last resort)
    • Windows reverse-resolves the active dynamic time-zone against the IANA table

    (01c53f0)

  • --timezone=<iana> override on location set

    • For users whose host OS timezone differs from their coordinates' real zone
    • Accepts both = and space-separated forms
    • Validates the zone is resolvable (rejects typos)
    • Tags zones as [override] or [from system OS] in success output
    • Includes inline hint pointing at the flag

    (bdb2650, 1133079)

  • SE Asia Standard Time → Asia/Jakarta
    Previously resolved to Asia/Bangkok by alphabetical accident.
    Indonesia-first default.

    (1455f0d)

  • Dropped Asia/Tehran from the Windows mapping — the project does not support Shia prayer-time calculations.

    (01c53f0)


Location command UX

  • location set no longer leaves stale state.
    Previously cached city, country, and timezone values from an earlier location auto could persist after a manual set.
    Now they are cleared properly and timezone is re-derived from the host OS.

    Closes the second half of #11.

    (925b40d)

  • location auto no longer auto-fills city
    IP-geolocated city values are often inaccurate (issue #11's reporter saw Damietta while living in Mansoura).

    country is still auto-populated since method auto-detection depends on it.

    (37e00cc)

  • New --city=<name> flag
    Available on both:

    • location set
    • location auto

    For users who want an explicit city label.

    (37e00cc)

  • User-facing examples (help output, error hints, README) now default to Asia/Jakarta instead of Africa/Cairo.

    (6949d3a)


New: sound command

Configurable notification sounds with three presets:

  • reminder
  • alarm
  • default

Linux routes presets to libnotify sound-name hints:

  • message-new-instant
  • alarm-clock-elapsed
  • none

Windows maps them to:

<audio src="ms-winsoundevent:..." />

The alarm preset loops for the toast duration.

Disabling sound emits:

  • XDG suppress-sound hint on Linux
  • <audio silent="true"/> on Windows

(0d02e7c)

New subcommands

muslimtify sound [status]
muslimtify sound on|off
muslimtify sound set <preset>            # it's-time notification
muslimtify sound reminder-set <preset>   # pre-prayer reminders

Refactor: source tree layout

  • Source files reorganized into:
src/
├── core/
├── cli/
└── platform/

(0f043fd)

  • muslimtify_lib split into:

    • muslimtify_core
    • muslimtify_cli

    OBJECT libraries.

    (b95acf0)

  • parse_timezone_offset moved into:

src/platform/{linux,windows}/timezone.c
  • src/core/location.c is back to pure curl + JSON with no time logic.

    (dd2f8b1)

  • GUI scaffolding removed from main:

    • ccompose
    • raylib
    • GTK4 launcher
    • muslimtify-gui target

    GUI development continues on the gui branch.

    (4601c1a, 0d02e7c)


CI / build fixes

  • Fixed silently-passing Windows CI.

    curl's FetchContent block leaked:

set(BUILD_TESTING OFF FORCE)

into the parent scope, causing ctest to report success with zero tests run.

Now explicitly using:

  • -DBUILD_TESTING=ON
  • --no-tests=error

on both platforms.

(e98be51, bc61426)

  • test_location is now cross-platform.

    Linked against:

    • ole32
    • runtimeobject

    on Windows because muslimtify_core pulls in notification_win.c.

    (e98be51, dd2f8b1)

  • Clang-format / clang-tidy globs updated to recurse into the new src/ subdirectories.

    (dd2b2e0)

  • MinGW cross-compile fixes:

    • case-sensitive <windows.h>
    • CURL_STATICLIB defined on Windows targets that include curl/curl.h

    (dd2f8b1)


Tests

New tests/test_location.c

83 assertions covering:

  • Northern hemisphere DST
  • No-DST fixed-offset zones
  • Fractional offsets (5:30, 5:45, etc.)
  • Southern hemisphere DST
  • Half-hour DST (Newfoundland)
  • UTC and Pacific edge cases
  • NULL input
  • Unknown zones
  • TZ env-var leak check (Linux only)

test_windows_zone_to_iana

36 cases covering every Windows zone in the mapping table.

test_get_system_timezone

New helper coverage.

CLI tests

7 new CLI cases in tests/test_cli.c covering:

  • --city
  • --timezone
  • equals and space-separated forms
  • no-flag-clears
  • missing-value rejection
  • combined flags

Verified

Linux

  • ctest: 10/10 suites pass
  • test_location: 83/83 assertions pass

Windows

  • MSVC Release build + tests via GitHub Actions
  • MinGW cross-compile to:
    • x86_64-w64-mingw32
    • working muslimtify.exe
    • working muslimtify-service.exe

Full changelog

v0.2.1...v0.2.2