One install recipe: just install installs everything
CI / test (push) Successful in 2m25s

just install now builds as you, then asks for root once and installs the
whole thing: the login session (wasm compositor on the MoonBit host,
modules, chandra-ctl, KDE colors, portal) and face unlock (helper, PAM
module, config, models). The alternatives are flags instead of recipes:
--link (was install-dev), --rust (install-rust), --native
(install-native), --pam (install-face --pam), --no-face, --no-models.
The PAM module is compiled as you into build/, so root only copies it;
without a compiler or libpam headers face unlock is skipped with a warning.
just uninstall removes face unlock too (--purge: enrolled faces).

Removed: install-dev, install-rust, install-native, install-face,
uninstall-face and the old install-session* / uninstall-session aliases.
New docs/install.md; README, docs and installer hints updated. Also drops
a committed __pycache__ file and ignores __pycache__/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkA52AocBmJHipFRqb
This commit is contained in:
Claude committed 2026-11-26 01:38:58 +00:00
1 parent e6be3825d0
commit 3e35c4dfa5
16 files changed
+171 -108

No files matched your search

+38 -53
View File
@@ -44,12 +44,12 @@ run: compositor-wasm wasmhost modules
rm -f {{socket}}
build/wasmhost build/compositor.wasm --socket {{socket}} --theme {{theme}} --window
# The same on the Rust host (host-wasm), kept as a fallback while the MoonBit host settles in.
# On an X server (NVIDIA's proprietary driver, docs/x11.md): a window under a window manager, or the whole screen without one.
run-x11: compositor-wasm wasmhost modules
rm -f {{socket}}
build/wasmhost build/compositor.wasm --socket {{socket}} --theme {{theme}} --x11
# The same on the Rust host (host-wasm), kept as a fallback while the MoonBit host settles in.
run-rust: compositor-wasm host-wasm modules
rm -f {{socket}}
host-wasm/target/release/chandra-host build/compositor.wasm --socket {{socket}} --theme {{theme}} --window
@@ -99,68 +99,53 @@ run-drm-native: build-release modules
-dbus-update-activation-environment --systemd WAYLAND_DISPLAY=$(basename {{socket}}) XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=chandra 2>/dev/null
{{release_exe}} --drm --socket {{socket}} --theme {{theme}}
# Install the Chandra login session (display-manager entry): the wasm compositor + its host (the MoonBit host). Asks for root once.
install: compositor-wasm wasmhost modules
scripts/as-root python3 "{{justfile_directory()}}/session/install.py"
# Dev install: symlink the session into this checkout, so after one root install `just compositor-wasm wasmhost modules` is all a rebuild needs.
install-dev: compositor-wasm wasmhost modules
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --link
# Install the login session with the Rust host (host-wasm) instead of the MoonBit one.
install-rust: compositor-wasm host-wasm modules
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --rust-host
# Install the login session with the native compositor instead.
install-native: build-release modules
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --native
# Install everything (login session, panel modules, KDE colors, portal, face unlock); builds as you, then asks for root once. Flags: --link, --rust, --native, --pam, --no-face (docs/install.md).
install *flags:
#!/usr/bin/env bash
set -euo pipefail
builds="compositor-wasm wasmhost modules"
face=1
for f in {{flags}}; do
case "$f" in
--rust|--native)
[ -z "${host:-}" ] || [ "$host" = "$f" ] || { echo "just install: --rust and --native exclude each other" >&2; exit 2; }
host=$f
if [ "$f" = --rust ]; then builds="compositor-wasm host-wasm modules"; else builds="build-release modules"; fi ;;
--no-face) face=0 ;;
--link|--pam|--no-models) ;;
*) echo "just install: unknown flag $f (--link, --rust, --native, --pam, --no-face, --no-models)" >&2; exit 2 ;;
esac
done
{{just_executable()}} --justfile "{{justfile()}}" $builds
extra=""
if [ "$face" = 1 ]; then
# Build the PAM module as you, so root only copies it.
cc=$(command -v cc || command -v gcc || command -v clang || true)
mkdir -p build
if [ -n "$cc" ] && "$cc" -O2 -Wall -shared -fPIC -o build/pam_chandra_face.so \
-DCHANDRA_FACE_HELPER='"/usr/local/lib/chandra/chandra-face"' face/pam_chandra_face.c -lpam; then
:
else
echo "warning: skipping face unlock: building its PAM module needs a C compiler and the libpam headers (libpam0g-dev / pam-devel)" >&2
extra="--no-face"
fi
fi
# Face unlock's Python + OpenCV come from a root-owned pixi environment: hand root our pixi.
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" {{flags}} $extra \
--pixi "$(command -v pixi || echo "$HOME/.pixi/bin/pixi")"
# Reload the running session's panel modules from disk (after install or `just modules`), keeping their order and settings. `just reload clock-digital` reloads one. See docs/reloading.md.
reload *name:
python3 session/chandra-ctl reload {{name}}
# Remove the login session again.
uninstall:
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --remove
# Install face unlock (PAM module + chandra-face + models; docs/face-unlock.md). `just install-face --pam` also turns it on for polkit-1 and sudo. The Settings rows come with the session: `just install` and log in again.
install-face *args:
scripts/as-root python3 "{{justfile_directory()}}/face/install.py" --pixi "$(command -v pixi || echo "$HOME/.pixi/bin/pixi")" {{args}}
# Remove face unlock (from every PAM service first). `just uninstall-face --purge` also deletes the enrolled faces.
uninstall-face *args:
scripts/as-root python3 "{{justfile_directory()}}/face/install.py" --remove {{args}}
# Remove everything `just install` installed (face unlock is taken out of every PAM service first). `just uninstall --purge` also deletes the enrolled faces and /etc/chandra/face.conf.
uninstall *flags:
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --remove {{flags}}
# Face unlock tests (fake camera; add --pam as root with pamtester to test the PAM module too).
test-face *args:
python3 face/test_face.py {{args}}
# Old names, kept so existing habits and scripts still work.
[private]
install-session:
@echo "note: install-session is now 'just install'" >&2
{{just_executable()}} --justfile "{{justfile()}}" install
[private]
install-session-dev:
@echo "note: install-session-dev is now 'just install-dev'" >&2
{{just_executable()}} --justfile "{{justfile()}}" install-dev
[private]
install-session-rust:
@echo "note: install-session-rust is now 'just install-rust'" >&2
{{just_executable()}} --justfile "{{justfile()}}" install-rust
[private]
install-session-native:
@echo "note: install-session-native is now 'just install-native'" >&2
{{just_executable()}} --justfile "{{justfile()}}" install-native
[private]
uninstall-session:
@echo "note: uninstall-session is now 'just uninstall'" >&2
{{just_executable()}} --justfile "{{justfile()}}" uninstall
# Start a Wayland client inside the running compositor (default: foot).
client *cmd="foot":
WAYLAND_DISPLAY={{socket}} {{cmd}}