aboutsummaryrefslogtreecommitdiff
path: root/modules/host-environment.el
Commit message (Collapse)AuthorAgeFilesLines
* docs(load-graph): seed module inventory and annotate foundation headersCraig Jennings12 days1-0/+11
| | | | | | I started the init.el load-graph classification with the foundation batch. I added docs/design/module-inventory.org as the living per-module inventory and annotated the seven foundation modules (system-lib, user-constants, host-environment, system-defaults, keyboard-compat, keybindings, config-utilities) with the load-graph header contract: layer, category, load shape, eager reason, top-level side effects, runtime requires, and direct-test-load safety. I changed no load order, so init.el keeps its current eager order. The inventory records one hidden dependency for Phase 2: system-defaults uses host-environment and user-constants symbols at load while declaring them eval-when-compile, so the compiled module cannot load standalone.
* refactor(host-env): fix env-desktop-p doc and normalize the X predicatesCraig Jennings14 days1-4/+7
| | | | | | env-desktop-p's docstring described a laptop, but the function returns t for the desktop case (no battery). env-x-p compared the window system against the string "x" while its sibling env-x11-p used `eq` against the symbol, so the two read differently for the same check. I corrected the docstring and switched env-x-p to the symbol comparison. I also spelled out the difference between env-x-p (any X display, including XWayland) and env-x11-p (a real X11 session, no Wayland). Behavior is unchanged, so the existing display-predicate tests stay green.
* fix(host-environment): correct docstring order in cj/detect-system-timezoneCraig Jennings2026-04-301-2/+2
| | | | | | | | | The numbered list in the docstring had file-comparison and TZ env var swapped relative to what the code does. The code tries cj/match-localtime-to-zoneinfo first, then falls back to TZ. Updated the docstring so the numbering matches the actual `or' chain. Surfaced while writing tests for the priority chain.
* fix(host-environment): detect battery correctly on Linux desktopsCraig Jennings2026-04-221-5/+30
| | | | | | | | `env-laptop-p` treated any `battery-format "%B"` value that wasn't literally "N/A" as "has a battery." On a Linux desktop using `battery-upower`, the result is "unknown". The AC adapter and USB-C power entries exist in /sys but there's no BAT*. That made desktops look like laptops. The per-machine font height switch in `font-config.el` broke as a result. The fix uses /sys/class/power_supply/BAT* as the canonical Linux signal. That's what the kernel exposes, and what upower itself reads. Other platforms keep the `battery-format` path, but the fallback now checks for a live battery status char ("!", "+", "-") instead of only excluding "N/A". Two pure helpers (`env--battery-status-char-indicates-battery-p`, `env--power-supply-has-battery-p`) keep the logic testable. The new test file covers Normal, Boundary, and Error cases for each helper.
* feat(env): add X11 and Wayland detection functionsCraig Jennings2026-02-011-0/+11
| | | | | env-x11-p returns t when on X11 (not Wayland). env-wayland-p checks WAYLAND_DISPLAY env var, works with XWayland.
* feat(calendar-sync): Add automatic timezone detection and chronological sortingCraig Jennings2025-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented calendar-sync.el as a complete replacement for org-gcal, featuring: **Core Functionality:** - One-way sync from Google Calendar to Org (via .ics URL) - UTC to local timezone conversion for all event timestamps - Chronological event sorting (past → present → future) - Non-blocking sync using curl (works reliably in daemon mode) **Automatic Timezone Detection:** - Detects timezone changes when traveling between timezones - Tracks timezone offset in seconds (-21600 for CST, -28800 for PST, etc.) - Triggers automatic re-sync when timezone changes detected - Shows informative messages: "Timezone change detected (UTC-6 → UTC-8)" **State Persistence:** - Saves sync state to ~/.emacs.d/data/calendar-sync-state.el - Persists timezone and last sync time across Emacs sessions - Enables detection even after closing Emacs before traveling **User Features:** - Interactive commands: calendar-sync-now, calendar-sync-start/stop - Keybindings: C-; g s (sync), C-; g a (start auto-sync), C-; g x (stop) - Optional auto-sync every 15 minutes (disabled by default) - Clear status messages for all operations **Code Quality:** - Comprehensive test coverage: 51 ERT tests (100% passing) - Refactored UTC conversion into separate function - Clean separation of concerns (parsing, conversion, formatting, sorting) - Well-documented with timezone behavior guide and changelog **Migration:** - Removed org-gcal-config.el (archived in modules/archived/) - Updated init.el to use calendar-sync - Moved gcal.org to .emacs.d/data/ for machine-independent syncing - Removed org-gcal appointment capture template Files modified: modules/calendar-sync.el:442, tests/test-calendar-sync.el:577 Files created: data/calendar-sync-state.el, tests/testutil-calendar-sync.el Documentation: docs/calendar-sync-timezones.md, docs/calendar-sync-changelog.md
* style:host-environment: Fix quoting in docstringsCraig Jennings2025-10-231-2/+3
| | | | | Correct the quoting style in docstrings for commands using backticks instead of incorrect characters.
* fix: host-env: fix battery func, mac-osx detection, and docstringsCraig Jennings2025-10-181-15/+17
|
* fix: host-environment: issue with string vs symbol for system-typeCraig Jennings2025-10-151-1/+1
|
* changing repositoriesCraig Jennings2025-10-121-0/+116