Configuration

This document pertains to mowedline 2.0.0.

Mowedline is configured by creating either a ~/.mowedline or $XDG_CONFIG_HOME/mowedline/init.scm file, or passing a file along with the -config command. If XDG_CONFIG_HOME is not specified in the environment, the value ~/.config will be used. The documentation will sometimes refer to this file as your ".mowedline", and when it does, it refers to either one. Some configuration can also be done by passing commands to the mowedline program.

Instead of using a static configuration format and being constrained by the implicit limitations thereof, a mowedline configuration is written in scheme (CHICKEN Scheme to be precise). Your .mowedline is a scheme program, allowing you to leverage the full power of the scheme programming language to configure, enhance, and extend mowedline in novel and creative ways.

The .mowedline file is loaded by the mowedline daemon at startup. Its primary responsibility is to create windows and populate them with widgets. If your .mowedline does not create a window, a default window with one widget will be created. Let's get right into an example.

(window
 (widget:text
  name: "default"
  flex: 1)))

Windows and widgets are instantiated with their specific procedure such as window and widget:text in the example. The arguments to each function depend on what you're creating. In the case of window there can first be pairs of property names and values, followed by any widgets you would like to add.

Every widget must have a unique name. The name is how widgets are referred to in the command-line interface.

The flex property is explained below.

For more complex, real-world examples, see examples. For all the fascinating details of the configuration API, read on…

Widget Types

There is a small selection of built-in widget types that you can use. We expect to write more widget types over time, as we the users invent new ideas.

Note: As of version 2.0.0 mowedline uses keywords instead of symbols to name properties. The examples in the documentation use the keyword: notation, but the #:keyword is also possible. Changing the keyword-style parameter in your configuration to #:prefix could also allow you to use :keyword, but this is mutually exclusive with keyword:. According to the CHICKEN documentation the #:keyword style is always accepted.

Common properties

These options can be used on any type of widget that appears in your configuration.

widget:text

widget:clock

All widget:text properties can be used with a clock.

widget:flags

The flags widget is derived from the text widget, and serves the purpose of displaying a set of flags. The flags are pre-defined via the flags: slot and upon update, input is parsed and interpreted to turn on, turn off, or clear and replace the set of currently displayed flags.

Input is parsed as follows. If the input begins with '+', then the following flagnames are turned on. If the input begins with '-', then the following flagnames are turned off. Otherwise, the given flagnames replace the current flag set. Flagnames are given in a simple sequence, separated by spaces.

Note: the text property of a flags widget will always be a markup structure, never a string, so format procedures should be adjusted accordingly.

Window Properties

Setting Defaults

The default values of many of the properties listed above can be changed by a group of parameter procedures. The following procedures are available for configuring defaults.

Use these procedures in your .mowedline before instantiating the widgets which are to be affected.

Examples

Change the default font for all text-widgets:

(text-widget-font "DejaVu Sans Mono-10:bold")

Change the default text color of all text-widgets:

(text-widget-color "#999999")