Skip to content

Editing config ​

Files and layers ​

All files live in $XDG_CONFIG_HOME/lys-shell/ (default ~/.config/lys-shell/).

FileWritten byRole
config.yaml (or config.yml)youYour settings. Created with only the schema modeline when missing.
runtime.yamllys-shell config, lys-settingsOverrides on top of config.yaml.
schema.jsonthe shell, at startupJSON Schema for editor completion.
.env, .*.envyouEnvironment variables for $NAME secrets.
themes/*.yamlyouCustom themes.
styles/index.cssyouCustom CSS.

Each field takes the first value found in runtime.yaml, then config.yaml, then the built-in default. Every field has a default, so declare only what you change:

yaml
bar:
  scale: 1.25
modules:
  clock:
    format: "%H:%M"

Every key is in the config reference. lys-shell does not read TOML: a config.toml without a config.yaml (or a runtime.toml without a runtime.yaml) is reported as an error until converted.

Live reload ​

The config directory is watched; saving a file applies it to the running shell. A file that fails to load (bad YAML, a missing or circular import) keeps the running config, or the defaults at startup. A field with an invalid value keeps its default while the rest of the file applies. Both are reported in the log.

Sizes ​

Every size field takes either a scale multiplier (a number; on the bar it is multiplied by bar.scale) or logical pixels as a string:

yaml
bar:
  button-icon-size: "20px"   # pixels, ignores bar.scale
  group-spacing: 1.5         # multiplier

Logical pixels are scaled for HiDPI outputs.

Imports ​

A top-level imports list loads other YAML files first:

yaml
imports: [themes/nord.yaml, modules/clock.yaml]
bar:
  scale: 1.25
  • Paths are relative to the importing file. Without an extension, .yaml is used, or .yml when only that exists.
  • Imports merge in order, then the importing file on top. Mappings merge key by key; scalars and lists replace.
  • Imported files may import others. A cycle is an error.
  • runtime.yaml does not resolve imports.

Secrets ​

A field of type Secret (API keys, for example) takes $NAME to read the environment variable NAME. .env and .*.env files in the config directory are loaded into the environment at startup and on change; a variable already set in the environment is kept.

Editor setup ​

Point a YAML language server at schema.json with this first line (the created config.yaml has it):

yaml
# yaml-language-server: $schema=./schema.json

VS Code needs the YAML extension; Neovim, Helix and Zed use yaml-language-server. The repository carries the same schema at schema/lys-shell-config.schema.json.

CLI ​

sh
lys-shell config get bar.scale
lys-shell config set modules.clock.format "%H:%M"
lys-shell config reset modules.clock.format
lys-shell config default --stdout   # every key with its default
lys-shell config schema --stdout    # the JSON Schema
  • set writes runtime.yaml. The value is parsed as YAML (true, 5, [a, b], {module: clock}); anything that does not parse is a string.
  • reset removes the override from runtime.yaml.
  • default and schema without --stdout write config.yaml.example and schema.json into the config directory.
  • config.yaml is never written by the CLI or lys-settings.

Released under the MIT License.