Skip to content

Commit

Permalink
NEW-CONFIG: WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed Sep 17, 2016
1 parent bedab2e commit b838be8
Showing 1 changed file with 122 additions and 0 deletions.
122 changes: 122 additions & 0 deletions docs/NEW-CONFIG.md
@@ -0,0 +1,122 @@
New Configuration Format
========================

Introduction
============

FVWM's configuration format is line-based. This means, each line is parsed by
itself, without any structure. This means, groups of commands such as
*functions* have no structural representation, other than to end with a blank
line. For example:

```
DestroyFunc Foo
AddToFunc Foo
+ I DoAThing
+ I DoAnotherThing
```

Indeed, because of this, structure has been represented through complexity;
the **+** command was created to address the fact that there was no grouping,
and hence the **+** command operates over *functions*, and *decor* commands.

Added to this is the fact that each possible command in FVWM (including how
that's represented in the configuration file) does its own parsing, leading to
a complete myriad of differences and duplication.

A new configuration file therefore must accept structural data, and have it
represented appropriately. Commands should receive information rather than
having to parse it itself.

Syntax
======

**[These are rough ideas for now...]**:

* Still line-based.
* Structured information can be represented like this:

```
Function -n func_name -i DoImmediate -c DoClick -h DoHold
```

* Ways of referring to windows:

```
-t: screen:desk.page
-w: n:name, c:class, r:resource|<win_id>|*
-g (global)
```

Example:

```
Style -w n:xteddy, c:XTeddy InitialMapCommand Sticky
Next -tfoo:1 -w c:XTeddy Echo "Found XTeddy on screen 'foo', desk 1"
```

Hence, `-t` and `-w` are consistent throughout the entirety of the command
set in FVWM.

* Setting options:

```
-g (global)
-t screen:desk.page
```

* Bindings:

```
-k: key
-m: mouse
cmd
```

Example:

```
bind -k CSM-w Close
bind -m 1 Close -t ...
```

* Menus:

```
-n: name of menu
-i: item name of command to run
command
```

Example:


```
menu -n menu_name -i item_name command1
menu -n menu_name -i item_name command2
menu -n menu_name -i item_name command3
```

Rough Example
=============

```
Colorset 1 bg red, fg red
Colorset 2 bg blue, fg blue
# Make all clients on screen 0, desk 1, red...
Style -t 0:1 -w* Colorset 1
# Make only XTerm windows on any screen blue
Style -g -w c:XTerm Colorset 2
# Focus next window on current monitor.
Focus -t+1
# Focus next window on monitor 1.
Focus -t1:+1
# Focus third window on monitor 1
Next -t1:+3 Focus
```

0 comments on commit b838be8

Please sign in to comment.