X11 backend: run Chandra on Xorg (NVIDIA's proprietary driver)
CI / test (push) Successful in 2m28s

--x11 shows the desktop on the X server in $DISPLAY: a resizable window
under a window manager (--fullscreen asks it for fullscreen), or the whole
screen when no window manager runs, following xrandr resizes.

compositor/x11 is a pure X11 wire-protocol client (no libX11/xcb), so it
runs in the wasm compositor on both hosts and in the native build. Frames
go through MIT-SHM 1.2 (ShmAttachFd of the host frame memfd, paced by
ShmCompletion), with a core PutImage fallback. The keymap given to clients
is the X server's own (xkbcomp -xkb $DISPLAY -); X auto-repeat is dropped,
modifier/lock state comes from X's modifier map; MIT-MAGIC-COOKIE-1 auth.

chandra-session --x11 (and the new "Chandra (X11)" xsessions entry) runs
it as the login session; --login-session gives an X11 session what --drm
implied (power actions, polkit agent, system theme). just run-x11.
Docs: docs/x11.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhLFs4VtHV26G1iyeo
This commit is contained in:
Claude committed 2026-11-26 01:37:49 +00:00
1 parent 90fdda2455
commit e6be3825d0
14 files changed
+1777 -19

No files matched your search

+8 -4
View File
@@ -50,8 +50,10 @@ about 4 seconds (the Rust host takes about 2 minutes). The **Rust host**
fallback until it is removed; any host change goes into both. A **native build** of the same
compositor code (no wasm, `just run-native`) is used by the test suite.
The compositor runs either **nested**, as a window on your current Wayland session, or as a
**login session** on DRM/KMS with libinput (`--drm`, through libseat/logind).
The compositor runs **nested**, as a window on your current Wayland session, as a **login
session** on DRM/KMS with libinput (`--drm`, through libseat/logind), or **on an X server**
(`--x11`: a window under an X window manager, or the whole screen without one), for NVIDIA's
proprietary driver on Xorg ([docs/x11.md](docs/x11.md)).
## Quickstart
@@ -74,7 +76,8 @@ 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` | Install the "Chandra" display-manager session (asks for root once) |
| `just run-x11` | On the X server in `$DISPLAY` (NVIDIA on Xorg; the whole screen when no window manager runs) |
| `just install` | Install the "Chandra" display-manager session, and "Chandra (X11)" for Xorg (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-rust` | The same with the Rust host |
@@ -85,7 +88,8 @@ just client # start foot inside it (or: just client konsol
| `just remote-build` | Build on a sprites.dev sprite (`CHANDRA_SPRITE`) and pull the artifacts back |
`build/wasmhost build/compositor.wasm --socket PATH` takes `--window` (nested), `--drm` (login
session), `--theme PATH`, `--no-restore`, `--profile`, `--size WxH` and `--gfx-out frame.png`
session), `--x11` (on Xorg; `--fullscreen` under a window manager, `--login-session` to act as the
desktop session), `--theme PATH`, `--no-restore`, `--profile`, `--size WxH` and `--gfx-out frame.png`
(render to a PNG, headless; add `--serve` to keep refreshing it). `WASMHOST_PROFILE=1` prints the
time spent in each host function every 5 seconds; `WASMHOST_TRACE=1` logs every host call.
`CHANDRA_DEBUG_CONFIGURE=1` (any host) logs each window's configures, acks and committed buffer
+92 -6
View File
@@ -2,7 +2,11 @@
/// operating system reached only through `@sys`. The wasm component (components/compositor)
/// calls `run`; on the native side it is the same code with `@sys` backed by a C shim.
///
/// Arguments: --socket PATH --theme PATH --window --drm --gfx-out PNG --serve --size WxH
/// Arguments: --socket PATH --theme PATH --window --drm --x11 --fullscreen --gfx-out PNG --serve
/// --size WxH. --x11 shows the desktop on the X server in $DISPLAY (a window, or the whole screen
/// when no window manager runs there); --fullscreen asks a window manager for a fullscreen window;
/// --login-session makes it the user's desktop session as --drm does (power actions, the polkit
/// agent, apps' dark/light preference), for chandra-session --x11.
/// --drm runs as a login session: the host takes the display (DRM/KMS) and input (libinput).
/// With --gfx-out alone one frame is written and the program exits; add --serve to keep running
/// and rewrite the PNG about twice a second (for looking at a live compositor without a display).
@@ -49,6 +53,9 @@ pub fn run(args : Array[String]) -> Int {
let mut serve = false
let mut profile = false
let mut drm = false
let mut x11 = false
let mut fullscreen = false
let mut login = false
let mut restore = true
let mut width = 1280
let mut height = 720
@@ -68,6 +75,15 @@ pub fn run(args : Array[String]) -> Int {
} else if a == "--drm" {
drm = true
i = i + 1
} else if a == "--x11" {
x11 = true // a window (or, with no window manager, the whole screen) on $DISPLAY
i = i + 1
} else if a == "--login-session" {
login = true // this is the user's desktop session (as --drm is): power, polkit, system theme
i = i + 1
} else if a == "--fullscreen" {
fullscreen = true // --x11 under a window manager: ask it for a fullscreen window
i = i + 1
} else if a == "--no-restore" {
restore = false // don't reopen the apps of the last session
i = i + 1
@@ -125,6 +141,28 @@ pub fn run(args : Array[String]) -> Int {
None
}
// X11 mode: a window on an X server (NVIDIA's Xorg driver has no usable KMS path for us), or
// the whole screen when no window manager runs there. Opened first so the desktop gets its size.
let xwin = if x11 && !drm {
let display = match @sys.getenv("DISPLAY") {
"" => ":0"
d => d
}
match @x11.X11Window::open(display, "Chandra", "chandra", width, height, fullscreen) {
Some(x) => {
width = x.width
height = x.height
Some(x)
}
None => {
@sys.log("failed to open a window on the X display " + display)
return 1
}
}
} else {
None
}
let gfx_surface = @gfx.Surface::new({ width: Some(width), height: Some(height) })
match @host.ChandraCompositor::new(socket_path, theme, width, height) {
@@ -138,8 +176,9 @@ pub fn run(args : Array[String]) -> Int {
}
Some(comp) => {
comp.shell.persist = true // remember which modules are loaded in the panel
comp.sync_system_theme = drm // the login session sets apps' dark/light preference
comp.login_session = drm // and power actions (suspend, power off) act on the machine
let login = drm || login
comp.sync_system_theme = login // the login session sets apps' dark/light preference
comp.login_session = login // and power actions (suspend, power off) act on the machine
comp.restore_state() // and the layout mode and recent apps from the last session
comp.shell.screen_w = width
// Screenshots and recordings read the host's framebuffer (it draws the desktop).
@@ -192,7 +231,7 @@ pub fn run(args : Array[String]) -> Int {
@sys.log("chandra compositor listening on " + socket_path)
// chandra-ctl's socket (reload panel modules from a script); SIGUSR1 reloads too.
ignore(comp.start_control(@host.control_socket_path(@sys.getenv("XDG_RUNTIME_DIR"), socket_path)))
if drm {
if login {
comp.start_auth_agent() // polkit's password prompts (run0, pkexec): Chandra's dialog
}
if restore {
@@ -339,7 +378,53 @@ pub fn run(args : Array[String]) -> Int {
busy = busy || input.length() > 0 || need_present
wait_fds.push(n.fd)
}
None => {
None =>
match xwin {
Some(x) => {
if !x.poll() {
break
}
if x.keymap.length() > 0 {
comp.server.set_keymap(x.keymap)
}
// The window or the screen (xrandr) changed size: draw the desktop at the new size.
match x.take_resize() {
Some((nw, nh)) => {
width = nw
height = nh
comp.resize(nw, nh)
need_present = true
busy = true
}
None => ()
}
if x.take_redraw() {
need_present = true // exposed: the X server has no copy of what was there
}
let now_ms = @sys.monotonic_ms().to_uint()
let input = x.take_input()
for ev in input {
comp.handle_input(ev, now_ms)
}
x.set_cursor_shape(comp.desired_cursor())
match comp.compose_scene() {
Some(sg) => {
let r0 = @sys.monotonic_ms()
@raster.submit(sg)
comp.prof_raster_ms = comp.prof_raster_ms + (@sys.monotonic_ms() - r0)
need_present = true
busy = true
}
None => ()
}
if need_present && x.frame_ready() {
x.present_frame(width, height)
need_present = false
}
busy = busy || input.length() > 0 || need_present
wait_fds.append(x.wait_fds())
}
None => {
comp.handle_gfx_events(gfx_surface)
match comp.compose_scene() {
Some(sg) => {
@@ -357,7 +442,8 @@ pub fn run(args : Array[String]) -> Int {
need_present = false
}
busy = busy || need_present
}
}
}
}
if profile {
p_n = p_n + 1
+1
View File
@@ -6,6 +6,7 @@ import {
"chandra/desktop/compositor/gfx" @gfx,
"chandra/desktop/compositor/host" @host,
"chandra/desktop/compositor/nested" @nested,
"chandra/desktop/compositor/x11" @x11,
"chandra/desktop/compositor/kms" @kms,
"chandra/desktop/compositor/raster" @raster,
}
+57 -4
View File
@@ -9,6 +9,8 @@ fn main {
let widgets : Array[String] = []
let mut windowed = false
let mut drm = false
let mut x11 = false
let mut fullscreen = false
let mut restore = true
let mut width = 1280
let mut height = 720
@@ -28,6 +30,12 @@ fn main {
} else if a == "--drm" {
drm = true
i = i + 1
} else if a == "--x11" {
x11 = true
i = i + 1
} else if a == "--fullscreen" {
fullscreen = true
i = i + 1
} else if a == "--no-restore" {
restore = false // don't reopen the apps of the last session
i = i + 1
@@ -71,6 +79,27 @@ fn main {
None
}
// X11 mode: a window (or the whole screen, without a window manager) on $DISPLAY.
let xwin = if x11 && !drm {
let display = match @env.get_env_var("DISPLAY") {
Some(d) => d
None => ":0"
}
match @x11.X11Window::open(display, "Chandra", "chandra", width, height, fullscreen) {
Some(x) => {
width = x.width
height = x.height
Some(x)
}
None => {
println("failed to open a window on the X display " + display)
return
}
}
} else {
None
}
let gfx_surface = @gfx.Surface::new({
width: Some(width),
height: Some(height),
@@ -175,10 +204,34 @@ fn main {
n.present(comp.present_to_gfx(gfx_ctx))
}
}
None => {
comp.handle_gfx_events(gfx_surface)
ignore(comp.present_to_gfx(gfx_ctx))
}
None =>
match xwin {
Some(x) => {
if !x.poll() {
break
}
if x.keymap.length() > 0 {
comp.server.set_keymap(x.keymap)
}
match x.take_resize() {
Some((nw, nh)) => comp.resize(nw, nh)
None => ()
}
ignore(x.take_redraw()) // every frame is presented here anyway
let now_ms = @env.now().to_uint()
for ev in x.take_input() {
comp.handle_input(ev, now_ms)
}
x.set_cursor_shape(comp.desired_cursor())
if x.frame_ready() {
x.present(comp.present_to_gfx(gfx_ctx))
}
}
None => {
comp.handle_gfx_events(gfx_surface)
ignore(comp.present_to_gfx(gfx_ctx))
}
}
}
@sys.sleep_ms(16)
}
+1
View File
@@ -7,6 +7,7 @@ import {
"chandra/desktop/compositor/gfx" @gfx,
"chandra/desktop/compositor/host" @host,
"chandra/desktop/compositor/nested" @nested,
"chandra/desktop/compositor/x11" @x11,
"chandra/desktop/compositor/kms" @kms,
}
+8
View File
@@ -0,0 +1,8 @@
import {
"moonbitlang/core/builtin",
"chandra/desktop/compositor/sys" @sys,
"chandra/desktop/compositor/renderer" @renderer,
"chandra/desktop/compositor/nested" @nested,
}
supported_targets = "+native+wasm"
File diff suppressed because it is too large. Load diff
+54
View File
@@ -0,0 +1,54 @@
///|
test "parse_display: local displays only" {
assert_eq(@x11.parse_display(":0"), Some((0, 0)))
assert_eq(@x11.parse_display(":1.2"), Some((1, 2)))
assert_eq(@x11.parse_display("unix:10"), Some((10, 0)))
assert_eq(@x11.parse_display("localhost:10.0"), None)
assert_eq(@x11.parse_display(""), None)
assert_eq(@x11.parse_display(":"), None)
}
///| One Xauthority entry: family, address, display number, auth name, data (big-endian lengths).
fn xauth_entry(family : Int, addr : String, num : String, data : Array[Byte]) -> Array[Byte] {
let out : Array[Byte] = []
fn field(b : Array[Byte]) -> Unit {
out.push(((b.length() >> 8) & 0xFF).to_byte())
out.push((b.length() & 0xFF).to_byte())
for c in b {
out.push(c)
}
}
fn text(s : String) -> Array[Byte] {
let b : Array[Byte] = []
for c in s {
b.push(c.to_int().to_byte())
}
b
}
out.push(((family >> 8) & 0xFF).to_byte())
out.push((family & 0xFF).to_byte())
field(text(addr))
field(text(num))
field(text("MIT-MAGIC-COOKIE-1"))
field(data)
out
}
///|
test "xauth_cookie: picks this host's entry for the display" {
let file : Array[Byte] = []
file.append(xauth_entry(256, "otherhost", "0", [b'\x01']))
file.append(xauth_entry(256, "rig", "1", [b'\x02']))
file.append(xauth_entry(256, "rig", "0", [b'\x03', b'\x04']))
let f = Bytes::from_array(file)
assert_eq(@x11.xauth_cookie(f, 0, "rig").to_array(), [b'\x03', b'\x04'])
assert_eq(@x11.xauth_cookie(f, 1, "rig").to_array(), [b'\x02'])
// No entry for this host: any local one for the display.
assert_eq(@x11.xauth_cookie(f, 0, "elsewhere").to_array(), [b'\x01'])
assert_eq(@x11.xauth_cookie(f, 7, "rig").length(), 0)
// FamilyWild (xauth's "ffff" entries, as Docker setups write) matches any host.
let wild = Bytes::from_array(xauth_entry(0xFFFF, "", "0", [b'\x09']))
assert_eq(@x11.xauth_cookie(wild, 0, "rig").to_array(), [b'\x09'])
}
+85
View File
@@ -0,0 +1,85 @@
# Running Chandra on Xorg (NVIDIA)
`--x11` runs Chandra on an X server instead of on DRM/KMS. It exists for machines where the
display is NVIDIA's proprietary driver on Xorg: the driver draws the screen, Chandra is one X
client on it, and Wayland apps connect to Chandra as usual.
```
build/wasmhost build/compositor.wasm --socket "$XDG_RUNTIME_DIR/wayland-moon-0" --x11
just run-x11 # the same, from the checkout
```
## Modes
| Where | What `--x11` does |
| --- | --- |
| An X desktop with a window manager (GNOME on Xorg, KDE X11, Openbox...) | A normal, resizable window (`--size WxH`, default 1280x720). `--fullscreen` asks the window manager for a fullscreen window. |
| An X server with no window manager (`startx`, `xinit`, the "Chandra (X11)" login entry, a headless NVIDIA Xorg in a container) | Chandra covers the whole screen, takes the keyboard, and follows the screen when it is resized (`xrandr`, as Selkies does when the browser window changes size). |
Chandra decides by looking for an EWMH window manager on the root window
(`_NET_SUPPORTING_WM_CHECK`).
## As your login session
`just install` also installs `/usr/share/xsessions/chandra-x11.desktop`. Pick **Chandra (X11)** on
the login screen (GDM, SDDM, LightDM): the display manager starts Xorg with the NVIDIA driver and
runs `chandra-session --x11`, which starts the compositor with `--x11 --login-session` (power
actions, the polkit password dialog and apps' dark/light preference, as in the DRM session).
Without a display manager, put this in `~/.xinitrc` and run `startx` from a text console:
```
exec /usr/local/bin/chandra-session --x11
```
The log is `~/.local/state/chandra/session.log`, as for the DRM session.
## How it works
`compositor/x11/x11.mbt` speaks the X11 wire protocol itself over `/tmp/.X11-unix/X<n>`, like the
nested backend speaks Wayland: no libX11 or libxcb, and the same code runs in the wasm compositor
(either host) and in the native build.
* **Authentication**: the `MIT-MAGIC-COOKIE-1` for the display from `$XAUTHORITY` (or
`~/.Xauthority`); this host's entry first, then a wildcard or any other local entry.
* **Frames**: MIT-SHM 1.2 with fd passing (`ShmAttachFd` + `ShmPutImage`). The host's framebuffer
memfd goes straight to the X server, so no pixels pass through the compositor, and the next
frame waits for the server's completion event. Needs a 24-bit TrueColor visual (any NVIDIA
setup at the default `DefaultDepth 24`). Without MIT-SHM it falls back to core `PutImage` in
strips, which is slow on the wasm hosts (about 2 frames a second at 1280x800, because the
pixels cross the component boundary); `CHANDRA_X11_NO_SHM=1` forces that path for debugging and
`CHANDRA_X11_DEBUG=1` logs its frame times.
* **Keyboard**: Xorg's keycodes are evdev codes + 8, the same as libinput's. The keymap sent to
Wayland clients is the X server's own (`xkbcomp -xkb $DISPLAY -`), so the layout and options
are whatever Xorg was configured with; after `setxkbmap` new apps get the new one. X's
auto-repeat is dropped (Wayland apps repeat keys themselves). Modifier and lock state come
from X's modifier map.
* **Pointer**: motion, buttons (left, middle, right, back, forward), wheel (buttons 4-7). The
cursor comes from the X cursor font, picked by the shape Chandra wants.
* **Input injection** (XTest, `xdotool`, Selkies, VNC servers) works, since it arrives as ordinary
X events.
## Limits
* **Apps don't get the NVIDIA GPU through Chandra.** Chandra composes on the CPU and its Wayland
clients share buffers with `wl_shm`; there is no `zwp_linux_dmabuf_v1` yet, so GPU-drawing apps
(games, Zed, Chrome with GPU raster) fall back to software rendering (llvmpipe/lavapipe) or
fail, exactly as on the DRM backend. Running on Xorg makes Chandra *start* on NVIDIA; it does not
give its apps hardware acceleration. See docs/kiosk-gamerig.md (G4).
* **X11-only apps run on the X server, not in Chandra.** `DISPLAY` stays set, so an app that only
speaks X11 (Steam, xterm) opens on Xorg directly: under a window manager it is a window beside
Chandra's; in whole-screen mode it maps on top of Chandra with no window manager to move it.
Chandra has no Xwayland.
* Only local displays (`:0`, `unix:0`): no TCP displays or `ssh -X`.
* Keyboard layout groups: the group is always reported as 0, so layout switching through XKB
groups (two layouts with a toggle key) shows the first layout's symbols in Wayland apps.
* One screen: Chandra covers the X screen it opened (multi-monitor setups are one big X screen
under NVIDIA's TwinView/xrandr, so Chandra spans all monitors).
## Isn't there a KMS path on NVIDIA now?
With the NVIDIA driver 545 or newer and `nvidia-drm.modeset=1` (the default from 560 on), NVIDIA
does offer KMS and dumb buffers, which is all `--drm` uses (no GBM, no EGL). So on a recent
driver the regular Chandra session may work too: try `just run-drm` from a text console. `--x11`
is for older drivers, `modeset=0` setups, and anywhere Xorg must stay the display server (a
streaming rig whose grabber reads the X screen).
+5
View File
@@ -45,6 +45,11 @@ run: compositor-wasm wasmhost modules
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
run-rust: compositor-wasm host-wasm modules
rm -f {{socket}}
host-wasm/target/release/chandra-host build/compositor.wasm --socket {{socket}} --theme {{theme}} --window
+1 -1
View File
@@ -52,5 +52,5 @@ if [ -d "$WASMER/lib" ]; then
fi
XDG_CONFIG_HOME="$(mktemp -d)" CHANDRA_TEST_CONFIG=1 \
moon test --target native --warn-list -a compositor/renderer compositor/gfx compositor/wasm \
compositor/network compositor/portal compositor/polkit compositor/host
compositor/network compositor/portal compositor/polkit compositor/x11 compositor/host
moon build --target native --warn-list -a compositor/bin
+23 -4
View File
@@ -1,7 +1,10 @@
#!/bin/sh
# Login-session entry point for Chandra (started by the display manager).
# Runs the compositor on the seat's display via DRM/KMS + libinput and logs to
# ~/.local/state/chandra/session.log. By default that is the compositor as a
# ~/.local/state/chandra/session.log. With --x11 (the "Chandra (X11)" entry in
# /usr/share/xsessions, or `exec chandra-session --x11` in ~/.xinitrc) it runs on the X server
# in $DISPLAY instead and covers the whole screen: for GPUs whose driver gives Chandra no KMS
# path, such as NVIDIA's proprietary one (docs/x11.md). By default that is the compositor as a
# WebAssembly component, run by chandra-host; if only the native binary was installed
# (session/install.py --native), it runs that instead.
share=/usr/local/share/chandra
@@ -28,6 +31,22 @@ if [ -z "$XDG_RUNTIME_DIR" ] && [ -d "/run/user/$(id -u)" ] && [ -O "/run/user/$
fi
case "$0" in /*) self="$0" ;; *) self="$PWD/$0" ;; esac # for the dbus-run-session re-exec
# The display backend: drm (default) or x11. Kept in the environment so the dbus-run-session
# re-exec below (which drops the arguments) still knows.
if [ "${1:-}" = "--x11" ]; then
export CHANDRA_BACKEND=x11
fi
case "${CHANDRA_BACKEND:-drm}" in
x11)
backend="--x11 --login-session"
if [ -z "${DISPLAY:-}" ]; then
echo "chandra-session: --x11 needs DISPLAY (start it from an X session or ~/.xinitrc)" >&2
exit 1
fi
;;
*) backend=--drm ;;
esac
export XDG_SESSION_TYPE=wayland
export XDG_CURRENT_DESKTOP=chandra
export XDG_SESSION_DESKTOP=chandra
@@ -95,7 +114,7 @@ fi
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment --systemd \
WAYLAND_DISPLAY="$(basename "$sock")" XDG_SESSION_TYPE XDG_CURRENT_DESKTOP \
XDG_SESSION_DESKTOP QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME >>"$log" 2>&1 ||
XDG_SESSION_DESKTOP QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME ${DISPLAY:+DISPLAY} >>"$log" 2>&1 ||
dbus-update-activation-environment \
WAYLAND_DISPLAY="$(basename "$sock")" XDG_SESSION_TYPE XDG_CURRENT_DESKTOP \
XDG_SESSION_DESKTOP QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME >>"$log" 2>&1 || true
@@ -122,7 +141,7 @@ fi
# A logind session without a seat (made by run0 --user=..., su - or ssh rather than by logging in
# on the VT) can't open the screen and input devices through logind; say so in the log, since
# the compositor's own error ("could not take control of the session") doesn't explain why.
if [ -n "$XDG_SESSION_ID" ] && command -v loginctl >/dev/null 2>&1; then
if [ "$backend" = --drm ] && [ -n "$XDG_SESSION_ID" ] && command -v loginctl >/dev/null 2>&1; then
seat=$(loginctl show-session "$XDG_SESSION_ID" -p Seat --value 2>/dev/null)
if [ -z "$seat" ]; then
echo "chandra-session: login session $XDG_SESSION_ID has no seat (started by run0, su or" \
@@ -157,5 +176,5 @@ for a in \
done
export CHANDRA_POLKIT_FALLBACK="$fallback"
exec "$@" --drm --socket "$sock" \
exec "$@" $backend --socket "$sock" \
--theme "$share/config/themes/moon-night.json" >>"$log" 2>&1
+7
View File
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=Chandra (X11)
Comment=Chandra desktop on the Xorg server, for GPUs without a KMS path Chandra can use (NVIDIA's proprietary driver)
Exec=/usr/local/bin/chandra-session --x11
TryExec=/usr/local/bin/chandra-session
Type=Application
DesktopNames=chandra
+4
View File
@@ -30,6 +30,7 @@ Installs:
/usr/local/share/chandra/{config,wit,assets}/ files the compositor reads at runtime
/usr/local/share/chandra/modules/*.wasm the panel's wasm modules (build them first: just modules)
/usr/share/wayland-sessions/chandra.desktop display-manager entry
/usr/share/xsessions/chandra-x11.desktop display-manager entry on Xorg (NVIDIA; docs/x11.md)
/usr/share/xdg-desktop-portal/portals/chandra.portal xdg-desktop-portal backend: the compositor
/usr/share/xdg-desktop-portal/chandra-portals.conf serves Settings (apps' dark/light preference)
"""
@@ -56,6 +57,7 @@ targets = [
"/usr/local/share/color-schemes/ChandraDark.colors",
"/usr/local/share/color-schemes/ChandraLight.colors",
"/usr/share/wayland-sessions/chandra.desktop",
"/usr/share/xsessions/chandra-x11.desktop",
"/usr/share/xdg-desktop-portal/portals/chandra.portal",
"/usr/share/xdg-desktop-portal/chandra-portals.conf",
]
@@ -144,6 +146,8 @@ for f in ("ChandraDark.colors", "ChandraLight.colors"):
put(os.path.join(root, "session/color-schemes", f), "/usr/local/share/color-schemes/" + f, 0o644)
# The display-manager entry stays a real file: some managers don't follow symlinks there.
put(os.path.join(root, "session/chandra.desktop"), "/usr/share/wayland-sessions/chandra.desktop", 0o644)
# The same desktop on an X server (the display manager starts Xorg): for NVIDIA's proprietary driver.
put(os.path.join(root, "session/chandra-x11.desktop"), "/usr/share/xsessions/chandra-x11.desktop", 0o644)
# xdg-desktop-portal reads backends only from /usr/share (or $XDG_DESKTOP_PORTAL_DIR), not
# /usr/local. With XDG_CURRENT_DESKTOP=chandra and no chandra-portals.conf it offered apps no
# Settings portal at all, so Chrome, Firefox, GTK 4 and Qt 6 never saw the Dark mode switch; the