From 940fcc823fd508b02eacd65941f0e285e23b7566 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Sun, 16 Aug 2026 11:09:25 -0300 Subject: [PATCH] refactor(projects/gtkhal): rename khora to gtkhal Assisted-by: pi (gpt-5.6-sol) --- pkgs/default.nix | 2 +- projects/gtkhal/.envrc | 1 + projects/{khora => gtkhal}/LICENSE | 0 projects/{khora => gtkhal}/README.md | 20 +++++++++---------- projects/{khora => gtkhal}/ROADMAP.md | 4 ++-- .../data/rs.m7.Gtkhal.desktop} | 6 +++--- .../data/rs.m7.Gtkhal.svg} | 0 projects/{khora => gtkhal}/default.nix | 16 +++++++-------- projects/gtkhal/gtkhal/__init__.py | 3 +++ .../khora => gtkhal/gtkhal}/__main__.py | 0 .../khora => gtkhal/gtkhal}/application.py | 10 +++++----- .../{khora/khora => gtkhal/gtkhal}/colors.py | 0 .../khora => gtkhal/gtkhal}/khal_adapter.py | 0 .../khora => gtkhal/gtkhal}/mini_calendar.py | 0 .../{khora/khora => gtkhal/gtkhal}/model.py | 0 .../{khora/khora => gtkhal/gtkhal}/state.py | 2 +- .../{khora/khora => gtkhal/gtkhal}/window.py | 4 ++-- projects/{khora => gtkhal}/pyproject.toml | 6 +++--- .../{khora => gtkhal}/tests/test_colors.py | 2 +- .../tests/test_khal_adapter.py | 2 +- .../{khora => gtkhal}/tests/test_model.py | 2 +- .../{khora => gtkhal}/tests/test_state.py | 2 +- projects/khora/.envrc | 1 - projects/khora/khora/__init__.py | 3 --- 24 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 projects/gtkhal/.envrc rename projects/{khora => gtkhal}/LICENSE (100%) rename projects/{khora => gtkhal}/README.md (68%) rename projects/{khora => gtkhal}/ROADMAP.md (95%) rename projects/{khora/data/rs.m7.Khora.desktop => gtkhal/data/rs.m7.Gtkhal.desktop} (80%) rename projects/{khora/data/rs.m7.Khora.svg => gtkhal/data/rs.m7.Gtkhal.svg} (100%) rename projects/{khora => gtkhal}/default.nix (79%) create mode 100644 projects/gtkhal/gtkhal/__init__.py rename projects/{khora/khora => gtkhal/gtkhal}/__main__.py (100%) rename projects/{khora/khora => gtkhal/gtkhal}/application.py (96%) rename projects/{khora/khora => gtkhal/gtkhal}/colors.py (100%) rename projects/{khora/khora => gtkhal/gtkhal}/khal_adapter.py (100%) rename projects/{khora/khora => gtkhal/gtkhal}/mini_calendar.py (100%) rename projects/{khora/khora => gtkhal/gtkhal}/model.py (100%) rename projects/{khora/khora => gtkhal/gtkhal}/state.py (96%) rename projects/{khora/khora => gtkhal/gtkhal}/window.py (99%) rename projects/{khora => gtkhal}/pyproject.toml (83%) rename projects/{khora => gtkhal}/tests/test_colors.py (90%) rename projects/{khora => gtkhal}/tests/test_khal_adapter.py (97%) rename projects/{khora => gtkhal}/tests/test_model.py (99%) rename projects/{khora => gtkhal}/tests/test_state.py (92%) delete mode 100644 projects/khora/.envrc delete mode 100644 projects/khora/khora/__init__.py diff --git a/pkgs/default.nix b/pkgs/default.nix index 8f290947..ad648f8b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -7,7 +7,7 @@ jellysearch = pkgs.callPackage ./jellysearch {}; website = pkgs.callPackage ../projects/website {}; runelite-mcp = pkgs.callPackage ../projects/runelite-mcp {}; - khora = pkgs.callPackage ../projects/khora {}; + gtkhal = pkgs.callPackage ../projects/gtkhal {}; runescape = pkgs.callPackage ./runescape {}; # Personal scripts diff --git a/projects/gtkhal/.envrc b/projects/gtkhal/.envrc new file mode 100644 index 00000000..73288b46 --- /dev/null +++ b/projects/gtkhal/.envrc @@ -0,0 +1 @@ +use flake .#gtkhal diff --git a/projects/khora/LICENSE b/projects/gtkhal/LICENSE similarity index 100% rename from projects/khora/LICENSE rename to projects/gtkhal/LICENSE diff --git a/projects/khora/README.md b/projects/gtkhal/README.md similarity index 68% rename from projects/khora/README.md rename to projects/gtkhal/README.md index c7ccc4bb..2c8c5760 100644 --- a/projects/khora/README.md +++ b/projects/gtkhal/README.md @@ -1,13 +1,13 @@ -# Khora +# gtkhal -Khora is a graphical calendar for local +gtkhal is a graphical calendar for local [vdirs](https://vdirsyncer.pimutils.org/). It uses khal for configuration, indexing, recurrence expansion, and iCalendar semantics; vdirsyncer remains in charge of talking to CalDAV servers. ## Status -Khora is an early, read-only prototype. It currently provides: +gtkhal is an early, read-only prototype. It currently provides: - a native GTK 4/libadwaita interface; - calendar discovery from the existing khal configuration; @@ -18,7 +18,7 @@ Khora is an early, read-only prototype. It currently provides: - explicit refreshes of khal's local index. Event creation and editing come next. The khal dependency is isolated in -`khora.khal_adapter` so its internal API can change without leaking through the +`gtkhal.khal_adapter` so its internal API can change without leaking through the application. ## Development @@ -26,18 +26,18 @@ application. Build and run it from the Foundry root: ```sh -nix build .#khora -nix run .#khora +nix build .#gtkhal +nix run .#gtkhal ``` -For a faster development loop, enter `projects/khora` and let direnv load its -Khora development shell, then run the source tree directly: +For a faster development loop, enter `projects/gtkhal` and let direnv load its +gtkhal development shell, then run the source tree directly: ```sh -python -m khora +python -m gtkhal ``` -Khora reads the same XDG configuration and vdirs as khal. It does not configure +gtkhal reads the same XDG configuration and vdirs as khal. It does not configure accounts or perform network synchronization. ## Keyboard shortcuts diff --git a/projects/khora/ROADMAP.md b/projects/gtkhal/ROADMAP.md similarity index 95% rename from projects/khora/ROADMAP.md rename to projects/gtkhal/ROADMAP.md index 7409c195..07f27455 100644 --- a/projects/khora/ROADMAP.md +++ b/projects/gtkhal/ROADMAP.md @@ -1,4 +1,4 @@ -# Khora roadmap +# gtkhal roadmap Planned improvements, ordered roughly from least to most implementation complexity. The order reflects engineering dependencies rather than product priority. @@ -30,4 +30,4 @@ The order reflects engineering dependencies rather than product priority. 13. **Advanced recurrence editor** — expose richer RFC 5545 recurrence rules, exceptions, and occurrence-level changes. 14. **Optional synchronization actions** — run vdirsyncer explicitly and show - progress/errors without making network synchronization Khora's default job. + progress/errors without making network synchronization gtkhal's default job. diff --git a/projects/khora/data/rs.m7.Khora.desktop b/projects/gtkhal/data/rs.m7.Gtkhal.desktop similarity index 80% rename from projects/khora/data/rs.m7.Khora.desktop rename to projects/gtkhal/data/rs.m7.Gtkhal.desktop index f5dc03cd..06761af4 100644 --- a/projects/khora/data/rs.m7.Khora.desktop +++ b/projects/gtkhal/data/rs.m7.Gtkhal.desktop @@ -1,8 +1,8 @@ [Desktop Entry] -Name=Khora +Name=gtkhal Comment=View calendars stored in local vdirs -Exec=khora -Icon=rs.m7.Khora +Exec=gtkhal +Icon=rs.m7.Gtkhal Terminal=false Type=Application Categories=Office;Calendar; diff --git a/projects/khora/data/rs.m7.Khora.svg b/projects/gtkhal/data/rs.m7.Gtkhal.svg similarity index 100% rename from projects/khora/data/rs.m7.Khora.svg rename to projects/gtkhal/data/rs.m7.Gtkhal.svg diff --git a/projects/khora/default.nix b/projects/gtkhal/default.nix similarity index 79% rename from projects/khora/default.nix rename to projects/gtkhal/default.nix index 195385ef..a46810a3 100644 --- a/projects/khora/default.nix +++ b/projects/gtkhal/default.nix @@ -9,7 +9,7 @@ wrapGAppsHook4, }: python3Packages.buildPythonApplication { - pname = "khora"; + pname = "gtkhal"; version = "0.1.0"; pyproject = true; @@ -19,7 +19,7 @@ python3Packages.buildPythonApplication { ./data ./README.md ./pyproject.toml - ./khora + ./gtkhal ./tests ]; }; @@ -45,17 +45,17 @@ python3Packages.buildPythonApplication { ''; postInstall = '' - install -Dm644 data/rs.m7.Khora.desktop \ - $out/share/applications/rs.m7.Khora.desktop - install -Dm644 data/rs.m7.Khora.svg \ - $out/share/icons/hicolor/scalable/apps/rs.m7.Khora.svg + install -Dm644 data/rs.m7.Gtkhal.desktop \ + $out/share/applications/rs.m7.Gtkhal.desktop + install -Dm644 data/rs.m7.Gtkhal.svg \ + $out/share/icons/hicolor/scalable/apps/rs.m7.Gtkhal.svg ''; meta = { description = "Graphical calendar for local vdirs"; - homepage = "https://github.com/misterio77/Foundry/tree/main/projects/khora"; + homepage = "https://github.com/misterio77/Foundry/tree/main/projects/gtkhal"; license = lib.licenses.bsd2; - mainProgram = "khora"; + mainProgram = "gtkhal"; platforms = lib.platforms.linux; }; } diff --git a/projects/gtkhal/gtkhal/__init__.py b/projects/gtkhal/gtkhal/__init__.py new file mode 100644 index 00000000..623b4584 --- /dev/null +++ b/projects/gtkhal/gtkhal/__init__.py @@ -0,0 +1,3 @@ +"""gtkhal, a graphical calendar for local vdirs.""" + +__version__ = "0.1.0" diff --git a/projects/khora/khora/__main__.py b/projects/gtkhal/gtkhal/__main__.py similarity index 100% rename from projects/khora/khora/__main__.py rename to projects/gtkhal/gtkhal/__main__.py diff --git a/projects/khora/khora/application.py b/projects/gtkhal/gtkhal/application.py similarity index 96% rename from projects/khora/khora/application.py rename to projects/gtkhal/gtkhal/application.py index 55df0e99..6784e9e0 100644 --- a/projects/khora/khora/application.py +++ b/projects/gtkhal/gtkhal/application.py @@ -10,12 +10,12 @@ gi.require_version("Gtk", "4.0") from gi.repository import Adw, Gdk, Gio, GLib, Gtk from .khal_adapter import KhalRepository -from .window import KhoraWindow +from .window import GtkhalWindow -class KhoraApplication(Adw.Application): +class GtkhalApplication(Adw.Application): def __init__(self) -> None: - super().__init__(application_id="rs.m7.Khora", flags=Gio.ApplicationFlags.DEFAULT_FLAGS) + super().__init__(application_id="rs.m7.Gtkhal", flags=Gio.ApplicationFlags.DEFAULT_FLAGS) self._interface_settings: Gio.Settings | None = None self._appearance_source = 0 self._gtk_css_monitor: Gio.FileMonitor | None = None @@ -250,9 +250,9 @@ class KhoraApplication(Adw.Application): except Exception as caught: repository = None error = str(caught) - window = KhoraWindow(self, repository, error) + window = GtkhalWindow(self, repository, error) window.present() def main() -> int: - return KhoraApplication().run(sys.argv) + return GtkhalApplication().run(sys.argv) diff --git a/projects/khora/khora/colors.py b/projects/gtkhal/gtkhal/colors.py similarity index 100% rename from projects/khora/khora/colors.py rename to projects/gtkhal/gtkhal/colors.py diff --git a/projects/khora/khora/khal_adapter.py b/projects/gtkhal/gtkhal/khal_adapter.py similarity index 100% rename from projects/khora/khora/khal_adapter.py rename to projects/gtkhal/gtkhal/khal_adapter.py diff --git a/projects/khora/khora/mini_calendar.py b/projects/gtkhal/gtkhal/mini_calendar.py similarity index 100% rename from projects/khora/khora/mini_calendar.py rename to projects/gtkhal/gtkhal/mini_calendar.py diff --git a/projects/khora/khora/model.py b/projects/gtkhal/gtkhal/model.py similarity index 100% rename from projects/khora/khora/model.py rename to projects/gtkhal/gtkhal/model.py diff --git a/projects/khora/khora/state.py b/projects/gtkhal/gtkhal/state.py similarity index 96% rename from projects/khora/khora/state.py rename to projects/gtkhal/gtkhal/state.py index 1a6fb34e..2cc82d02 100644 --- a/projects/khora/khora/state.py +++ b/projects/gtkhal/gtkhal/state.py @@ -18,7 +18,7 @@ class UiState: class StateStore: def __init__(self, path: Path | None = None) -> None: state_home = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local/state")) - self.path = path or state_home / "khora" / "state.json" + self.path = path or state_home / "gtkhal" / "state.json" def load(self) -> UiState: try: diff --git a/projects/khora/khora/window.py b/projects/gtkhal/gtkhal/window.py similarity index 99% rename from projects/khora/khora/window.py rename to projects/gtkhal/gtkhal/window.py index b8b92a44..ae4fde89 100644 --- a/projects/khora/khora/window.py +++ b/projects/gtkhal/gtkhal/window.py @@ -65,7 +65,7 @@ class EventLayer(Gtk.Fixed): return GLib.SOURCE_CONTINUE -class KhoraWindow(Adw.ApplicationWindow): +class GtkhalWindow(Adw.ApplicationWindow): def __init__( self, application: Adw.Application, @@ -73,7 +73,7 @@ class KhoraWindow(Adw.ApplicationWindow): error: str | None = None, state_store: StateStore | None = None, ) -> None: - super().__init__(application=application, title="Khora") + super().__init__(application=application, title="gtkhal") self.set_default_size(1280, 800) self._repository = repository self._state_store = state_store or StateStore() diff --git a/projects/khora/pyproject.toml b/projects/gtkhal/pyproject.toml similarity index 83% rename from projects/khora/pyproject.toml rename to projects/gtkhal/pyproject.toml index 456e23bd..fc3c58b8 100644 --- a/projects/khora/pyproject.toml +++ b/projects/gtkhal/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=77"] build-backend = "setuptools.build_meta" [project] -name = "khora-calendar" +name = "gtkhal" version = "0.1.0" description = "A graphical calendar for local vdirs" readme = "README.md" @@ -15,10 +15,10 @@ dependencies = [ ] [project.scripts] -khora = "khora.application:main" +gtkhal = "gtkhal.application:main" [tool.setuptools.packages.find] -include = ["khora*"] +include = ["gtkhal*"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/projects/khora/tests/test_colors.py b/projects/gtkhal/tests/test_colors.py similarity index 90% rename from projects/khora/tests/test_colors.py rename to projects/gtkhal/tests/test_colors.py index 4de7da90..85305eb6 100644 --- a/projects/khora/tests/test_colors.py +++ b/projects/gtkhal/tests/test_colors.py @@ -1,4 +1,4 @@ -from khora.colors import contrasting_foreground, display_color +from gtkhal.colors import contrasting_foreground, display_color def test_preserves_html_colors() -> None: diff --git a/projects/khora/tests/test_khal_adapter.py b/projects/gtkhal/tests/test_khal_adapter.py similarity index 97% rename from projects/khora/tests/test_khal_adapter.py rename to projects/gtkhal/tests/test_khal_adapter.py index 57031c3b..82b14faa 100644 --- a/projects/khora/tests/test_khal_adapter.py +++ b/projects/gtkhal/tests/test_khal_adapter.py @@ -2,7 +2,7 @@ import datetime as dt from pathlib import Path from types import SimpleNamespace -from khora.khal_adapter import KhalRepository +from gtkhal.khal_adapter import KhalRepository def test_calendar_accounts_come_from_their_parent_directory() -> None: diff --git a/projects/khora/tests/test_model.py b/projects/gtkhal/tests/test_model.py similarity index 99% rename from projects/khora/tests/test_model.py rename to projects/gtkhal/tests/test_model.py index d5deb734..278926bf 100644 --- a/projects/khora/tests/test_model.py +++ b/projects/gtkhal/tests/test_model.py @@ -1,6 +1,6 @@ import datetime as dt -from khora.model import ( +from gtkhal.model import ( Event, event_slot_range, layout_event_lanes, diff --git a/projects/khora/tests/test_state.py b/projects/gtkhal/tests/test_state.py similarity index 92% rename from projects/khora/tests/test_state.py rename to projects/gtkhal/tests/test_state.py index ffd05493..a5479b87 100644 --- a/projects/khora/tests/test_state.py +++ b/projects/gtkhal/tests/test_state.py @@ -1,4 +1,4 @@ -from khora.state import StateStore, UiState +from gtkhal.state import StateStore, UiState def test_round_trips_ui_state(tmp_path) -> None: diff --git a/projects/khora/.envrc b/projects/khora/.envrc deleted file mode 100644 index e8ff23c0..00000000 --- a/projects/khora/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake .#khora diff --git a/projects/khora/khora/__init__.py b/projects/khora/khora/__init__.py deleted file mode 100644 index 32333ea7..00000000 --- a/projects/khora/khora/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Khora, a graphical calendar for local vdirs.""" - -__version__ = "0.1.0"