System settings daemon of SanarDE.
  • C 87.9%
  • Meson 12.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-07 15:45:06 +05:00
core build(core): register the core tests 2026-11-07 15:38:33 +05:00
daemon test(daemon): cover the release of left registrations 2026-11-07 15:45:06 +05:00
data build(data): install the schema and the autostart entry 2026-11-07 15:38:34 +05:00
include feat(include): add subscriptions that the host tracks 2026-11-07 15:45:06 +05:00
.gitignore chore: ignore the build directories 2026-11-07 15:38:32 +05:00
CONTRIBUTING.md docs: add CONTRIBUTING 2026-11-07 15:38:35 +05:00
LICENSE docs: add the GPL-3.0 license text 2026-11-07 15:38:32 +05:00
meson.build build: add the Meson project 2026-11-07 15:38:32 +05:00
meson_options.txt build: add the module_dir option 2026-11-07 15:38:32 +05:00
README.md docs: describe tracked subscriptions and the signal mask 2026-11-07 15:45:06 +05:00

Sanar V9nd

Note

Repository Mirrors

  • git.nuros.org (sanarde/v9nd): primary, self-hosted Forgejo instance, accounts restricted to the core team.
  • GitHub (sanarde/v9nd): mirror for external contributors. Issues and Pull Requests opened here are welcome and are reviewed and processed by the core team.

About

System settings daemon of SanarDE, named after Väinämöinen. It does not apply any setting itself and loads the modules that do.

Dependencies

  • C17 compiler
  • Meson (>= 1.0) and Ninja
  • libcfgd, the client library of cfgd
  • dlopen from the C library

Build

meson setup build
meson compile -C build
meson test -C build
meson install -C build

The install step puts v9nd in bin, the header v9nd/module.h and v9nd.pc in the usual places, the cfgd schema in share/cfgd/schemas and the autostart entry in <sysconfdir>/xdg/autostart. Modules are searched in <libdir>/v9nd. Use -Dmodule_dir=PATH to change it.

Running

v9nd runs one event loop with one connection to cfgd. Only one instance can run per session. v9nd -m DIR reads the modules from DIR.

The key modules of the cfgd schema org.nuros.sanar.v9n, path /org/nuros/sanar/v9n/, lists the names of the modules to load. A change applies without a restart: new names are loaded, removed names are stopped and unloaded. A module that cannot be loaded or started is reported on the standard error output and skipped.

cfgd set /org/nuros/sanar/v9n/modules 'keyboard;fonts'

A name has up to 63 characters of a-z, 0-9 and -, and does not start with -.

Modules

A module is a shared object NAME.so in the module directory. It exports one object named v9nd_module of type struct v9nd_module, see module.h:

  • api is V9ND_MODULE_API and name is NAME.
  • start(host, &instance) returns zero on success. stop(instance) releases everything the module holds.
  • v9nd_host_cfgd(host) returns the cfgd connection of the daemon, which the module uses to read its keys. v9nd_host_subscribe(host, prefix, fn, user) subscribes to changes and v9nd_host_unsubscribe(host, id) removes the subscription. The daemon calls cfgd_dispatch().
  • v9nd_host_watch(host, fd, events, fn, user) adds a descriptor to the event loop, v9nd_host_unwatch(host, fd) removes it.

A module removes its subscriptions and descriptors in stop(). The ones it leaves behind are removed by the daemon and reported on the standard error output. Modules run inside the daemon and in its single thread, so a callback must not block. The daemon blocks SIGTERM and SIGINT, and a module that starts a process must reset the signal mask in it. Modules ship their own cfgd schemas. Compile with pkg-config --cflags v9nd and install to pkg-config --variable=moduledir v9nd.

License

GPL-3.0-only. See LICENSE.