ratpoison supports command line arguments to request various actions when invoking ratpoison.
windowscommand and some def* commands. Instead of displaying the window list in a message window, it is printed to stdout. The output can then be captured and used in the ratpoison script. For instance, this could be used to check whether a program is running and if it is switch to its window otherwise launch it.
It should also be noted that multiple -c options can be used.
to facilitate writing scripts, the RATPOISON environment variable is set to the full path of the ratpoison binary.
$ ratpoison -c split -c split
Here ratpoison would split the current frame twice.