diff --git a/README.md b/README.md index f0a2aa2..6ed5538 100644 --- a/README.md +++ b/README.md @@ -74,11 +74,11 @@ just client # start foot inside it (or: just client konsol |---|---| | `just run` | Nested in a window on your Wayland session, MoonBit host | | `just run-drm` | As a login session on the real screen (from a text console, as yourself) | -| `just install-session` | Install the "Chandra" display-manager session (asks for root once) | -| `just install-session-dev` | Same, but symlinked into this checkout: later just rebuild | +| `just install` | Install the "Chandra" display-manager session (asks for root once) | +| `just install-dev` | Same, but symlinked into this checkout: later just rebuild | | `just reload` | Reload the running session's panel modules from disk (`chandra-ctl reload [NAME]`) | -| `just run-rust`, `run-drm-rust`, `install-session-rust` | The same with the Rust host | -| `just run-native`, `run-drm-native`, `install-session-native` | The native (non-wasm) build | +| `just run-rust`, `run-drm-rust`, `install-rust` | The same with the Rust host | +| `just run-native`, `run-drm-native`, `install-native` | The native (non-wasm) build | | `just compositor-wasm`, `wasmhost`, `host-wasm`, `modules` | Build one piece | | `just test` | Native compositor tests and lib tests | | `just frame` | Render one composed frame to `_build/e2e_frame.png` | diff --git a/compositor/host/control.mbt b/compositor/host/control.mbt index 5e53fe8..282c4ac 100644 --- a/compositor/host/control.mbt +++ b/compositor/host/control.mbt @@ -1,5 +1,5 @@ ///| The control socket: lets scripts outside the session reload panel modules (after -/// `just install-session` or a module rebuild) without clicking through Settings > Panel. +/// `just install` or a module rebuild) without clicking through Settings > Panel. /// /// A unix stream socket at `$XDG_RUNTIME_DIR/chandra/.sock`, for example /// `/run/user/1000/chandra/wayland-moon-0.sock` (`control_socket_path`). XDG_RUNTIME_DIR is diff --git a/compositor/shell/widgets.mbt b/compositor/shell/widgets.mbt index cd43c6f..002fd0a 100644 --- a/compositor/shell/widgets.mbt +++ b/compositor/shell/widgets.mbt @@ -472,7 +472,7 @@ fn DesktopShell::replace_slot_result(self : DesktopShell, slot : String, path : } } -///| Reload panel modules from disk (after `just install-session` or a module rebuild): each +///| Reload panel modules from disk (after `just install` or a module rebuild): each /// loaded module whose module id, file stem, slot or path is `name` (every module when `name` is /// empty) is loaded again from its path and takes the old instance's place in the panel. Its /// settings (state.edn `:module-config`) are applied to the new instance as at login. A module diff --git a/docs/dark-mode.md b/docs/dark-mode.md index ab66b02..a69c211 100644 --- a/docs/dark-mode.md +++ b/docs/dark-mode.md @@ -23,7 +23,7 @@ which asks the portal, never saw the preference that gsettings held. ## Checking it on your machine -After reinstalling (`just install-session`) and logging in to Chandra again: +After reinstalling (`just install`) and logging in to Chandra again: ```sh # 1 = dark, 2 = light; flip the switch and run it again diff --git a/docs/reloading.md b/docs/reloading.md index 191e6c0..e0e5bb0 100644 --- a/docs/reloading.md +++ b/docs/reloading.md @@ -1,6 +1,6 @@ # Picking up a new build in a running session -After `just install-session` the files under `/usr/local` are new, but the running session keeps +After `just install` the files under `/usr/local` are new, but the running session keeps what it loaded at startup. What can be swapped without logging out: | Part | Reload without logout? | How | @@ -18,12 +18,12 @@ that: without the handler the signal's default action ends the session. ## Reloading panel modules ``` -just install-session # or: just modules, with install-session-dev +just install # or: just modules, with install-dev just reload # reload every panel module from disk just reload clock-digital # just one ``` -`just reload` runs `session/chandra-ctl reload`; `just install-session` also installs it as +`just reload` runs `session/chandra-ctl reload`; `just install` also installs it as `/usr/local/bin/chandra-ctl`: ``` diff --git a/docs/run0.md b/docs/run0.md index 5c19f1a..831818c 100644 --- a/docs/run0.md +++ b/docs/run0.md @@ -15,11 +15,11 @@ Everything below works with sudo, doas or pkexec too; run0 is only preferred whe ## Installing the login session ```bash -just install-session # or install-session-dev / install-session-native / uninstall-session +just install # or install-dev / install-native / uninstall ``` These go through `scripts/as-root`, which uses run0 if systemd is PID 1 and run0 is installed, -else sudo, doas or pkexec (`CHANDRA_AS_ROOT=sudo just install-session` picks one). It resolves +else sudo, doas or pkexec (`CHANDRA_AS_ROOT=sudo just install` picks one). It resolves the program to an absolute path first, because run0 would otherwise look it up in the service manager's `PATH`, and passes the installer by absolute path, so the working directory doesn't matter. By hand, from the checkout's root: @@ -28,7 +28,7 @@ matter. By hand, from the checkout's root: run0 python3 session/install.py # run0 keeps the working directory when the target is root ``` -Don't run `just` itself under run0 (`run0 just install-session`): the recipes build as you first, +Don't run `just` itself under run0 (`run0 just install`): the recipes build as you first, and under run0 `just` finds neither pixi nor moon, and would leave root-owned build outputs. ## Starting the desktop @@ -38,7 +38,7 @@ run the compositor and every app as root, put the socket in root's runtime direc apps don't look, and write settings under `/root`; `chandra-session` refuses (override with `CHANDRA_ALLOW_ROOT=1` if you really mean it). -- **Display manager:** pick "Chandra" in the session menu (installed by `just install-session`). +- **Display manager:** pick "Chandra" in the session menu (installed by `just install`). - **From a text console:** log in on the VT as yourself and run `chandra-session` (installed), or `just run-drm` (from the checkout). logind gives that login session the seat, which is what lets the compositor open the screen and input devices without being root. diff --git a/host-wasm/README.md b/host-wasm/README.md index 39d5c1b..c8abb4a 100644 --- a/host-wasm/README.md +++ b/host-wasm/README.md @@ -69,7 +69,7 @@ each is served here. `cargo test --release` loads the built modules (`just modul flips and a hardware cursor, libinput keyboard and pointer, an xkb keymap, libseat for device access and VT switching. It is the compositor's own C shim (`compositor/kms/kms_stub.c`) compiled into this host by `build.rs` (feature `drm`, on by default; `--no-default-features` leaves it out), so the native and -wasm backends can't drift. Run `just run-drm` from a login VT, or `just install-session` to add Moon +wasm backends can't drift. Run `just run-drm` from a login VT, or `just install` to add Moon Plasma to your display manager (`session/install.py`; `--native` installs the native compositor instead). Not yet exercised on a real VT; it is only built and instantiated. diff --git a/justfile b/justfile index f211537..2c43bf0 100644 --- a/justfile +++ b/justfile @@ -95,29 +95,55 @@ run-drm-native: build-release modules {{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-session: compositor-wasm wasmhost modules +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-session-dev: compositor-wasm wasmhost modules +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-session-rust: compositor-wasm host-wasm modules +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-session-native: build-release modules +install-native: build-release modules scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --native -# Reload the running session's panel modules from disk (after install-session or `just modules`), keeping their order and settings. `just reload clock-digital` reloads one. See docs/reloading.md. +# 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-session: +uninstall: scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --remove +# 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}} diff --git a/scripts/as-root b/scripts/as-root index 1d554aa..392e0f5 100755 --- a/scripts/as-root +++ b/scripts/as-root @@ -1,6 +1,6 @@ #!/bin/sh # Run one command as root with whatever this system uses for that: run0 (systemd 256+), else -# sudo, doas, or pkexec. Used by `just install-session` and friends. +# sudo, doas, or pkexec. Used by `just install` and friends. # # scripts/as-root python3 session/install.py # diff --git a/scripts/build-wasmhost.sh b/scripts/build-wasmhost.sh index 5f99eee..72b9ca5 100755 --- a/scripts/build-wasmhost.sh +++ b/scripts/build-wasmhost.sh @@ -21,7 +21,7 @@ if [ -d "$PIXI/lib" ]; then fi moon build --target native --release --warn-list -a wasmhost/bin mkdir -p build -# Replace it by renaming, so a running session (install-session-dev links to it) keeps its copy. +# Replace it by renaming, so a running session (install-dev links to it) keeps its copy. cp _build/native/release/build/wasmhost/bin/bin.exe build/wasmhost.new mv -f build/wasmhost.new build/wasmhost echo "build/wasmhost $(stat -c %s build/wasmhost) bytes" diff --git a/session/install.py b/session/install.py index ccf6360..4647d51 100755 --- a/session/install.py +++ b/session/install.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Install (or remove) the Chandra login session. Run as root, once (`just install-session` etc. do +"""Install (or remove) the Chandra login session. Run as root, once (`just install` etc. do this through scripts/as-root, which uses run0 and falls back to sudo, doas or pkexec): run0 python3 session/install.py # install: the compositor as a wasm component @@ -54,7 +54,7 @@ targets = [ ] if os.geteuid() != 0: - sys.exit("run as root: run0 python3 session/install.py (or sudo), or `just install-session`") + sys.exit("run as root: run0 python3 session/install.py (or sudo), or `just install`") if "--remove" in sys.argv: for t in targets: diff --git a/wasmhost/README.md b/wasmhost/README.md index 1a23f64..e25cd51 100644 --- a/wasmhost/README.md +++ b/wasmhost/README.md @@ -1,8 +1,8 @@ # wasmhost The host that runs the compositor component (`build/compositor.wasm`): `just run`, `just run-drm` -and `just install-session` use it. It replaces the Rust `host-wasm/`, which stays as a fallback -(`just run-rust`, `just run-drm-rust`, `just install-session-rust`). +and `just install` use it. It replaces the Rust `host-wasm/`, which stays as a fallback +(`just run-rust`, `just run-drm-rust`, `just install-rust`). It links wasmtime as the prebuilt C API library (`libwasmtime.a` from the upstream `wasmtime-v$WASMTIME_VERSION-x86_64-linux-c-api` release, fetched by `scripts/setup-toolchain.sh`