Node:Script initialization, Next:, Previous:Scripting Introduction, Up:Writing scripts

Initialization of the script-fu system

When GNUbik starts up, it scans the following directories in the order given for files with a .scm extension, and executes them in the order found (not necessarily alphabetical!) The directories searched are

Note that the exact location of the share directory is system dependent. The share/gnubik/guile directory is for scripts which the GNUbik program itself needs to function. They should not be changed once the GNUbik package is installed in a system. The share/gnubik/scripts directory is the place for system administrators to put scripts that all users can see on their GNUbik menus. Finally, the .gnubik/scripts directory is located under your home directory, and may contain any scripts that you have written, and which will only appear on the menu when you start the program up.

When the system finds a script, that script is executed and must use the following function to register itself with an item on GNUbik's menu bar.

gnubik-register-script menu-path code Procedure
menu-path should be a string indicating how the script should appear under the Script-fu menu, using / characters to indicate sub-menus and _ characters in front of a letter to indicate that that letter should be used as the keyboard accelerator for the menu item. For example, the string solvers/my _solver will create an item under the solvers sub-menu, with s as the keyboard shortcut.

The second argument code should be a string specifying scheme code to run when the menu item is selected. It should usually be the name of a procedure which is the entry point for the script.