Files
mesh-catalog/modules/xorg/module.json
T
jochen b2c170acda xorg: the display server holds node-display-server and writes the session's start (hq ADR 0208)
The X server, its start and its tools as one module. It provides x11-display with
the machine's reach, gated by the host's seat capability. It writes a block at the
start of ~/.xinitrc: the account's environment, an explicit import into the user
manager, the mesh's X resources merged without cpp, autorandr, the xinitrc slots,
~/.xinitrc.local, and the session's exec from the last slot.

Its Go tools serve the seat's displays and layout (autorandr profiles keyed by
EDID), and set-mode, primary, dpi, input devices and settings, keyboard, a
screenshot (xwd decoded in Go) and the server's log. internal/desktop is how
every desktop tool finds the operator's session from the runtime, which has none:
from the session's own processes, reading only its words, confirmed with logind.
2026-10-04 13:21:47 +02:00

122 lines
5.5 KiB
JSON

{
"module": "xorg",
"version": "1",
"capabilities": [
"package-manager",
"seat"
],
"provides": [
{
"name": "x11-display",
"reach": "machine"
}
],
"claims": [
{
"name": "node-display-server",
"scope": "node",
"serves": [
"displays",
"layout"
]
}
],
"tools": [
"xorg_set_mode",
"xorg_primary",
"xorg_dpi",
"xorg_input_devices",
"xorg_input_set",
"xorg_keyboard",
"xorg_screenshot",
"xorg_x_log"
],
"resources": [
{
"id": "package-xorg-server",
"type": "package",
"package": "xorg-server"
},
{
"id": "package-xorg-xinit",
"type": "package",
"package": "xorg-xinit"
},
{
"id": "package-xorg-xrandr",
"type": "package",
"package": "xorg-xrandr"
},
{
"id": "package-xorg-xset",
"type": "package",
"package": "xorg-xset"
},
{
"id": "package-xorg-xrdb",
"type": "package",
"package": "xorg-xrdb"
},
{
"id": "package-xorg-xinput",
"type": "package",
"package": "xorg-xinput"
},
{
"id": "package-xorg-setxkbmap",
"type": "package",
"package": "xorg-setxkbmap"
},
{
"id": "package-xorg-xwd",
"type": "package",
"package": "xorg-xwd"
},
{
"id": "package-autorandr",
"type": "package",
"package": "autorandr"
},
{
"id": "config",
"type": "directory",
"path": "${machine:account-home}/.config/xorg",
"owner": "${machine:account}",
"mode": "0755"
},
{
"id": "xresources",
"type": "file",
"path": "${machine:account-home}/.config/xorg/xresources",
"owner": "${machine:account}",
"mode": "0644",
"content": "! The mesh's X resources (module xorg, novox/hq ADR 0208 §4), replaced at every push. The session's\n! start merges them with xrdb -nocpp before ~/.Xresources, so your own resources there win. Without\n! the preprocessor there is no #include or #define here, and a line starting with # is skipped,\n! which is what the line naming each contributing module is.\n!\n! Font rendering, as both workstations had it. 96 DPI becomes a setting with issue 168; xorg_dpi\n! changes it for the running session.\nXft.dpi: 96\nXft.antialias: 1\nXft.hinting: 1\nXft.hintstyle: hintslight\nXft.rgba: rgb\n${shell:xresources:first}${shell:xresources:normal}${shell:xresources:last}\n"
},
{
"id": "xinitrc",
"type": "file",
"path": "${machine:account-home}/.xinitrc",
"owner": "${machine:account}",
"mode": "0755",
"into": "block",
"at": "start",
"content": "# The mesh's block (module xorg, novox/hq ADR 0208 §5): the graphical session's start, replaced at\n# every push. It ends by starting the session, so no line below it in this file runs any more. A line\n# of your own that must run at every session start goes in ~/.xinitrc.local, which this block sources\n# just before the session starts (the module's README lists where each of today's lines went).\n\n# 1. The account's environment (ADR 0203): the file every shell sources, written by node-environment.\nif [ -r \"${machine:account-home}/.config/mesh/environment.sh\" ]; then\n . \"${machine:account-home}/.config/mesh/environment.sh\"\nfi\n\n# The session bus is the user manager's. pam_systemd normally hands it over; when it did not, take\n# the canonical socket rather than starting a second bus, which runs every D-Bus-activated service\n# twice (two notifiers, two portals) and hides one copy from the other.\nif [ -z \"$DBUS_SESSION_BUS_ADDRESS\" ] && [ -S \"/run/user/$(id -u)/bus\" ]; then\n DBUS_SESSION_BUS_ADDRESS=\"unix:path=/run/user/$(id -u)/bus\"\n export DBUS_SESSION_BUS_ADDRESS\nfi\n\n# 2. The session's own words into the user manager and D-Bus activation, so the portal, the notifier\n# and every user service see the display and the desktop's identity. An explicit list and never\n# --all: a session's environment may hold things no user service should be able to read back.\nmesh_words=\nfor mesh_word in DISPLAY XAUTHORITY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP \\\n XDG_CONFIG_HOME XDG_DATA_DIRS GTK_THEME GTK2_RC_FILES QT_QPA_PLATFORMTHEME QT_STYLE_OVERRIDE \\\n QT_SELECT XCURSOR_THEME XCURSOR_SIZE TERMINAL; do\n if printenv \"$mesh_word\" >/dev/null 2>&1; then\n mesh_words=\"$mesh_words $mesh_word\"\n fi\ndone\ndbus-update-activation-environment --systemd $mesh_words\nunset mesh_word mesh_words\n\n# 3. X resources: the mesh's, then yours in ~/.Xresources, which win. The mesh's file is merged\n# without the C preprocessor, so no compiler is needed for it.\nxrdb -nocpp -merge \"${machine:account-home}/.config/xorg/xresources\"\nif [ -r \"$HOME/.Xresources\" ]; then\n xrdb -merge \"$HOME/.Xresources\"\nfi\n\n# 4. The monitors: the saved layout profile that matches the monitors connected, if one does.\nif command -v autorandr >/dev/null 2>&1; then\n autorandr --change >/dev/null 2>&1 || true\nfi\n\n# 5. Other modules' session lines (ADR 0208 §4), then yours.\n${shell:xinitrc:first}${shell:xinitrc:normal}if [ -r \"$HOME/.xinitrc.local\" ]; then\n . \"$HOME/.xinitrc.local\"\nfi\n\n# 6. The session itself: the holder of node-display-session starts it from the last slot.\n${shell:xinitrc:last}\n"
}
],
"build": {
"artifacts": [
{
"name": "tools",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/xorg",
"binary": "xorg",
"loads": [
"xorg"
]
}
]
}
}