The code, themes and tooling that the Greylock Labs apps share: Callie, Jot and, where it fits, Woodshed. Each app includes core as a git submodule, so a change made here reaches an app only when the app takes a new release of core.
For now core holds the tooling, the themes and the theme engine, the start of the greylock::core C++ library. More of
the shared C++, the Greylock.Ui QML module and the shared site files move in next.
-
CMakeLists.txtandcpp/buildgreylock::core, a static Qt 6 library in thegreylock::namespace, with the built-in themes compiled in at:/greylock/themes/<id>.toml. It needs Qt 6.8 or later, with Qt Network, and toml++. It holds:greylock::Appandgreylock::identity: the app's name, id and folders.- The theme engine:
greylock::color(OKLCH, contrast and hex parsing),greylock::ThemeSpec,greylock::ThemeLoaderandgreylock::base16. greylock::ThemeLibrary: the user's own theme files.- The desktop session, over D-Bus, for an app that keeps running in the background:
greylock::TrayItem(its tray entry, with the menu the app gives it),greylock::FreedesktopNotifications,greylock::SingleInstance(one copy per session, which a second launch brings forward), andgreylock::Autostartwithgreylock::StartAtLogin(start at login, through the Background portal in a Flatpak). They need Qt D-Bus. greylock::desktop::useDesktopFileDialogs(): called first inmain, it gives file and folder dialogs the desktop's own chooser, through its portal, with its places and bookmarks.greylock::installTranslations()andcmake/GreylockTranslations.cmake: an app's strings, core's among them, in Qt translation files, with English wording that can be edited apart from the code.greylock::logfile: the app's log file beside the terminal, kept short, with debug messages on request.greylock::problemreportandgreylock::issues: "Report a problem", sent to the shared report service or opened as a new issue in the app's repository.greylock::ui, linked apart fromgreylock::coreby apps drawn in Qt Quick:LiveQmlserves the app's QML from its source folder and reloads it on every save.- The command line, in
greylock::cli:PaintandPalettecolor a terminal's output in the theme,UpdateHintends a command with a word about a newer release, andUpgradeis an app'supgradeanddowngradecommands, installing GitHub's package for this system after checking its checksum. - Releases:
greylock::ReleaseNotesreads the app's built-in changelog,greylock::releasesandgreylock::PackageSystemread GitHub's releases and pick this system's package, andgreylock::UpdateCheckasks GitHub for the latest release at most once a day.
Callie and Callie Light are the suite's built-in theme names in every app, and
callieis the default theme every other inherits from. -
android/buildsorg.greylocklabs:ui, the Compose library the Android apps share: every built-in theme as Kotlin, generated fromthemes/at build time,GreylockThemeto draw an app in one, the fonts, and the components every app uses, such asStickerButton,PillChoice,SwitchRowandEmptyState. It needs JDK 21 and the Android SDK. -
fonts/holds Nunito and Fraunces, the suite's fonts, with their SIL Open Font License files. -
themes/*.tomlare the built-in themes every app ships: Callie, Callie Light, Minimal, Minimal Dark, Paper, Tomorrow and Tomorrow Night.callie.tomlsets every key, and the others inherit what they leave out. -
tooling/release.sh,check-version.shandrelease-notes.shrelease an app: they date the notes inCHANGELOG.md, set the version, runmake check, then commit, tag and push, undoing the commit and tag if the push is refused. A Qt app's version is set in CMake, the RPM spec, the Debian changelog and the AppStream metainfo, and its name and id come from itsCMakeLists.txt. An Android app's version is itsVERSIONfile, kept within Play's version code, and its name comes fromsettings.gradle.kts. -
tooling/release.mkholds thereleaseandrelease-drytargets.common.mkincludes it, and an app withoutcommon.mk, such as Woodshed, includes it alone, settingRELEASE_SCOPEif its commits need a scope. -
tooling/source-tarball.shwrites an app's release tarball with core's buildable files, such as the themes, included atcore/, sincegit archiveleaves submodules out. -
tooling/common.mkholds the everyday make targets:build,run,logs,watch,gallery,screenshots,test,lint,format,check,releaseand the rest. An app's Makefile sets its own values and includes it. -
tooling/format.shformats or checks C++ and QML with clang-format and qmlformat. -
tooling/commitlint.mjsholds the commit rules; an app passes in its own scopes. -
tooling/commit-msgruns commitlint as a git hook. -
The format and lint configs:
.clang-format,.clangd,.qmlformat.ini,.qmllint.ini,.editorconfig,.prettierrc,.prettierignore,.markdownlint-cli2.yamlandcliff.toml.
Add core on its release branch, which only moves when core tags a release:
git submodule add -b release https://github.com/greylocklabs/core coreThen, from the app's root:
-
Add core to the top-level
CMakeLists.txt, after the app's warning flags so they apply to core too, saying which app it is built for, and link the targets that use it togreylock::core:set(GREYLOCK_APP_ID "org.example.Demo") # the release build's id; a development build adds .Devel set(GREYLOCK_APP_NAME "Demo") set(GREYLOCK_APP_DIR "demo") # the folder under each XDG directory, the package and the resource prefix set(GREYLOCK_APP_ENV "DEMO") # the prefix of environment overrides, such as DEMO_FLATPAK set(GREYLOCK_APP_REPO "greylocklabs/demo") # the GitHub repository releases are published to set(GREYLOCK_APP_UBUNTU_DEBS OFF) # Ubuntu takes demo-ubuntu_*.deb, built apart from Debian's demo_*.deb set(GREYLOCK_APP_DEVEL OFF) # a development build, with its own identity add_subdirectory(core)
-
Keep the app's strings in
translations/<GREYLOCK_APP_DIR>_en.ts, with core's included, by naming the targets whose code has them, and callgreylock::installTranslations(app)right after making the application:greylock_add_translations(democore SOURCE_TARGETS democore demoui demo-gui)
make translationsreads the strings out of the code again, and thetranslations_currenttest fails while a file is stale. Another language is anothertranslations/demo_<language>.ts. The build needs Qt's Linguist tools:qt6-qttools-develandqt6-linguiston Fedora,qt6-tools-devandqt6-l10n-toolson Debian. -
Link each config into the root, where the tools look for it, for example
ln -s core/tooling/.clang-format .clang-format, and the hook asln -s ../core/tooling/commit-msg .githooks/commit-msg. -
Write
commitlint.config.mjsas:import { config } from "./core/tooling/commitlint.mjs"; export default config(["core", "gui", "ci", "deps", "deps-dev"]);
-
Write the
Makefileas the app's own values followed byinclude core/tooling/common.mk; the top ofcommon.mklists the values it reads. -
Call the scripts from the root, as
core/tooling/release.sh minor, from CI. -
Check out submodules in CI, with
submodules: trueonactions/checkout, and build the release tarball withcore/tooling/source-tarball.sh. Add/core export-ignoreto the app's.gitattributes, so the app's own archive leaves the empty submodule folder out; the script adds core's files back. -
Add a
gitsubmoduleentry to.github/dependabot.yml, so each core release opens a pull request.
An Android app includes the Compose library from the same submodule, in settings.gradle.kts:
includeBuild("core/android")and depends on it with implementation("org.greylocklabs:ui"), then wraps its content in GreylockTheme { }.
common.mk also expects dev and ci CMake presets, with a ci workflow and an all_qmllint target, format:md
and format:md:check scripts in package.json, a GUI and gallery that take --theme, --screenshot and
--live-qml, and a CLI with logs --follow. The top of common.mk lists the same.
The scripts expect the app's files where Callie and Jot keep them: CMakeLists.txt with project(<app> and
set(<APP>_APP_ID ...), packaging/rpm/<app>.spec, packaging/debian/control and changelog,
data/<app id>.metainfo.xml, and CHANGELOG.md with an ## Unreleased section. An Android app, as Woodshed, needs
VERSION, settings.gradle.kts with rootProject.name, and the same CHANGELOG.md.
npm install
cmake -S . -B build -G Ninja -DGREYLOCK_WERROR=ON && cmake --build build && ctest --test-dir build
tests/release_test.sh # releases made-up Qt and Android apps to local remotes
tests/tarball_test.sh # builds a made-up app's release tarball
tests/make_test.sh # includes common.mk, and release.mk alone, in made-up apps
npm run format:check
(cd android && ./gradlew spotlessCheck :ui:testDebugUnitTest :ui:lintRelease)Write the notes under ## Unreleased in CHANGELOG.md, then on an up-to-date main run scripts/release.sh 0.2.0. It
dates the notes, tags v0.2.0, and moves the release branch to it.