Startup Commands

On startup, modo can run any Command System, although none are defined by default.

Config File Format

To add startup commands, you first add a root-level <StartupCommands> atom tag to your config. This contains any number of <Command> list tags, which in turn represent the individual commands themselves. These commands will be executed in the order they are listed. Startup commands are executed at the very end of the startup process, just before the input loop starts. This example creates a simple hello on startup through the Dialog Commands series of commands.

1
2
3
4
5
 <nowiki><atom type="StartupCommands">
     <list type="Command">dialog.setup info</list>
     <list type="Command">dialog.msg "Hello!"</list>
     <list type="Command">dialog.open</list>
 </atom></nowiki>

Late Startup Commands

In some cases a startup command needs to be executed a bit later in the startup sequence, such as after networking, license checking, and some other systems have been initialized. Such commands can be added by using the <LateCommand> list type instead of the <Command> list type. These can be mixed and matched in the <StartupCommands> atom as needed.

Scripts as Startup Commands

Any command can be executed as a startup command, including scripts. Startup commands are intentionally executed before license checking occurs. This allows you to perform stand-alone operations before the user gets control. If you want your script to run without user interaction, you’ll want to be sure to prefix commands with one or two exclamation point to suppress any dialogs they might open.

The following execute the Perl script ‘’MyScript.pl’’.

1
2
3
 <atom type="StartupCommands">
     <list type="Command">@MyScript.pl</list>
 </atom>

If run without a license, modo will open the license dialog will open after the startup commands finish executing. You can issue app.quit as a startup command to quit before the license dialog appears.

1
2
3
4
 <atom type="StartupCommands">
     <list type="Command">@MyScript.pl</list>
     <list type="Command">app.quit</list>
 </atom>

Rendering with Startup Commands

See the Network Rendering article for information about using startup commands for fire-and-forget rendering.

See Also