# GUM v.1.0.0

# A

# Gimp start flags and rc-files

Most of the time Gimp is probably started by an icon or a menu in your favorite window manager but you can also start it by hand. There are also several initiation files that control the behavior of Gimp.

## Gimp command line switches aka flags (options)

A excellent source of information about the command line switches and environments that Gimp support is found in the Gimp man page. It's located in the `doc dir` in your Gimp source distribution and normally you only have to type `man gimp` after you have installed Gimp.

We will make a short description of each flag here in GUM. All of this is done in a shell, for example in an xterm window or rxvt window. As we mentioned earlier, you have probably hidden all this in your Window manager so you only have to click on a icon or drag at a menu. If you want to test flags and different environments or even run gimp without Xwindow you must do this in a shell.

Typing `gimp --help` or `gimp -h` and press `enter` will result in a short description of available flags that you can give Gimp.

    [olof@olof olof]$ gimp --help
    Usage: gimp [option ...] [files ...]
    Valid options are:
      -h --help              Output this help.
      -v --version           Output version info.
      -b --batch <commands>  Run in batch mode.
      -n --no-interface      Run without a user interface.
      --no-data              Do not load patterns, gradients, palettes, brushes.
      --verbose              Show startup messages.
      --no-splash            Do not show the startup window.
      --no-splash-image      Do not add an image to the startup window.
      --no-shm               Do not use shared memory between GIMP and its plugins.
      --no-xshm              Do not use the X Shared Memory extension.
      --display <display>    Use the designated X display.
    [olof@olof olof]$

The `-h` and `--help` flags obviously printed out the above message. The `-v` and `--`version flags shows what version of Gimp you are running (this information is also available in the about dialog and the splash window that shows up when you start Gimp). It will typically look like this:

    [olof@olof olof]$ gimp -v
    GIMP version 1.0

Always visit `www.gimp.org or ftp.gimp.org` or one of it's mirrors to get the newest stable version of Gimp.

#### Batch mode and "no-interface"

The -b and --batch option allows you to execute Gimp with arguments to run. This is ideal if you want to execute a lot commands to a lot of files. Then its can be quite annoying to have a GUI to do it in (i.e. open image, apply commands, save image, open another image, apply command etc., you see it will be a lot of mouse training if you want to do this). The `<command>` is a script-fu that will do the actual work for you (even if you can execute ordinary `gimp pdb` command directly)

The -n and --no-interface are suitable if you run Gimp in batch mode since you most of the time don't want to have a user interface if you are running a batch. This will also save some memory and system resources, so it would be quite pointless to fire up the user interface. Here is an example of two batch commands

    gimp -n -b '(gimp-procedural-db-dump "pdb_dump.tmp")' '(gimp-quit 0)'

which will dump Gimp's pdb database to a file called `pdb_dump.tmp` in your working directory. Here is a example of a custom script that is invoked by Gimp (`my-script` is your own personal custom script).

    gimp -n -b '(my-script 1 "\"Sample text.\"")' '(gimp-quit 0)'

The (gimp-quit 0) is so Gimp quits gracefully and returns the command prompt to you.

If you don't have Xwindow up and running (i.e you are running your UNIX session in a console that has no graphic capabilities or you have a modem connection to your UNIX host with a vt100 terminal only), then you still can run Gimp in batch mode, just do it like this:

    Xvfb :1 -screen 0 10x10x8 -pixdepths 1 &
    gimp --display :1.0 -n -b '<commandos> ' '(gimp-quit 0)'

This will fire up an invisible X server, which you run Gimp in.

#### More options

As you saw above, we introduced a new flag --display, since X lets you run Gimp on one host and displaying it on another, you have to specify the display to run Gimp's user interface on.

Normally you run and display Gimp on the same host, and you don't have to barter about display settings. We will give you an example on how to use the display option in Gimp. Say that you have a "Supercomputer" at your campus running UNIX and this computer has Gimp installed. Then it would be more than efficient to edit huge Gimp images at this computer while displaying them at your local workstation or X-terminal. Here is a quick how to do it. At your workstation, you will have to execute a command allowing the Supercomputer to display Gimp on your workstation.

    [olof@olof olof]$ xhost niceriver.frozenriver.com (my local supercomputer ;)
    niceriver.frozenriver.com being added to access control list

The second line tells us that we have enabled the "supercomputer" to access our X-server at our workstation. All we have to do now is to`telnet` or `rlogin` or `rsh` to the "supercomputer"

    [olof@olof olof]$ rlogin niceriver.frozenriver.com
    [olof@niceriver olof]$

Now we are logged in to the "supercomputer". All we have to is to fire off Gimp and tell it where to display, i.e at `olof.frozenriver.com,` and which display to use at olof.frozenriver.com. Since we only have one display at `olof` we will use display number 0

    gimp --no-xshm --display olof.frozenriver.com:0.0

Now Gimp will display at your workstation and you can work with it just like you would have if you had run Gimp at your workstation. When you are finished with Gimp you just have to logout from the supercomputer and tell your workstation that you don't want the supercomputer accessing your X-server

    [olof@olof olof]$ xhost - niceriver.frozenriver.com
    niceriver.frozenriver.com being removed from access control list

The last line tells us that the supercomputer no longer can access our X-server. There are of course better ways to handle remote display, i.e better security, automatic transfer of the display environment etc. but this is beyond the scope of this book.

As you saw above, we introduced a new option `--no-xshm`, which tells Gimp not to try to use X shared memory. We have to do this because we ran Gimp on a different host. If we run Gimp at the same host that we displayed Gimp at, we can use X shared memory to speed things up a little bit, and also so we will be lean onsystem resources. There is another shared memory flag`--no-shm` which tells Gimp not to share memory with its plug-ins. It's generally good to let Gimp do this but if you encounter problems it can be wise to turn it off.

The `--no-splash` tells Gimp to not show the splash when it starts. If you just tell Gimp`--no-splash-image` then the splash will be shown, but without the image.

`--verbose` will start up Gimp+ a little more verbose and you will se in the shell how it's phrasing the different initiations files.

    [olof@olof olof]$ gimp --verbose
    parsing "/home/olof/.gimp/gtkrc"
    parsing "/usr/local/share/gimp/gimprc"
    parsing "/home/olof/.gimp/gimprc"
    parsing "/home/olof/.gimp/pluginrc"

    writing "/home/olof/.gimp/pluginrc"
    parsing "/home/olof/.gimp/menurc"
    Starting extensions: extension_script_fu

The last option is `--no-data` which you can use if you run Gimp in batch mode and don't need brushes, gradients, palettes or patterns. The start up time for Gimp will then be minimized.

## Initiations files aka rc files

Gimp has a lot of initiations files which controls the behavior of Gimp. Most of the options that you set in different rc files are done by the preference dialog see chapter 5. We will only take a look at the options that you can't set from the dialog.

### gimprc and ~/.gimp/gimprc

The system-wide`gimprc` and the personal `gimprc` located in your gimp directory ( i.e usually `~/.gimp/gimprc`) control nearly all of Gimp's options. To change things in your personal `gimprc` file (`~/.gimp/gimprc`) you have to bring it up in an editor and edit the file.

`[olof@olof olof]$ xemacs ~/.gimp/gimprc`

There won't be much in it, because most of the options are written in the system-wide `gimprc` file (usually `/usr/local/share/gimp/gimprc)`. If you want to change a system-wide setting, then copy it from the system-wide `rc` file, paste it into your personal `rc` and then change the setting of it. Since the system-wide `rc` file is phrased before the personal `rc` file, everything written in the personal file will override what's written in the system-wide file. It's a good idea to open the system-wide `rc` file to get a glimpse of what you can change. If you are a system administrator it's wise to change the system-wide `rc` file to fit your site's needs. We will take a look at the`rc` file.

As you can see, the file is more or less self-explaining, and we will only comment on things that you can't set in the preference dialog.

    # This is the system-wide gimprc file. Any change made in this file
    # will affect all users of this system, provided that they are not
    # overriding the default values in their personal gimprc file.
    #
    # Lines that start with a '#' are comments.
    # Blank lines are ignored.

    # The variable gimp_dir is set to either the interned value
    # .gimp or the environment variable GIMP_DIRECTORY. If

    # the path in GIMP_DIRECTORY is relative, it is considered
    # relative to your home directory.

    (prefix "/usr/local")
    (exec_prefix "${prefix}")
    (gimp_data_dir "${prefix}/share/gimp")
    (gimp_plugin_dir "${exec_prefix}/lib/gimp/0.99")

You shouldn't change these preferences, but if you feel you must, you can only do it in an editor

    # Set the temporary storage directory...files will appear here
    # during the course of running the gimp. Most files will disappear
    # when the gimp exits, but some files are likely to remain,
    # such as working palette files, so it is best if this directory
    # not be one that is shared by other users or is cleared on machine
    # reboot such as /tmp.
    (temp-path "${gimp_dir}/tmp")

    # Set the swap file location. The gimp uses a tile based memory
    # allocation scheme. The swap file is used to quickly and easily
    # swap files out to disk and back in. Be aware that the swap file
    # can easily get very large if the gimp is used with large images.
    # Also, things can get horribly slow if the swap file is created on
    # a directory that is mounted over NFS.  For these reasons, it may
    # be desirable to put your swap file in "/tmp".
    (swap-path "${gimp_dir}")

    # Set the brush search path...this path will be searched for valid
    #  brushes at startup.
    (brush-path "${gimp_dir}/brushes:${gimp_data_dir}/brushes")

    # Specify a default brush. If none is specified it defaults to the

    #  "1circle.gbr" brush which is just a single pixel sized brush.
    #  The brush is searched for in the brush path.
    (default-brush "19fcircle.gbr")

Not adjustable in the pref. dialog

    # Set the pattern search path...this path will be searched for valid
    #  patterns at startup.
    (pattern-path "${gimp_dir}/patterns:${gimp_data_dir}/patterns")

    # Specify a default pattern.
    #  The pattern is searched for in the specified pattern paths.
    (default-pattern "wood2.pat")

Not adjustable in the pref. dialog

    # Set the palette search path...this path will be searched for valid
    #  palettes at startup.
    (palette-path "${gimp_dir}/palettes:${gimp_data_dir}/palettes")

    # Specify a default palette.
    #  The pattern is searched for in the specified pattern paths.
    (default-palette "Default")

Not adjustable in the pref. dialog

    # Set the gradient search path...this path will be searched for valid
    #  gradients at startup.
    (gradient-path "${gimp_dir}/gradients:${gimp_data_dir}/gradients")

    # Specify a default gradient.
    #  The gradient is searched for in the specified gradient paths.

    (default-gradient "German_flag_smooth")

Not adjustable in the pref. dialog

    # Set the plug-in search path...this path will be searched for
    #  plug-ins when the plug-in is run.
    (plug-in-path "${gimp_dir}/plug-ins:${gimp_dir}/plug-ins/script-fu:${gimp_plugin_dir}/plug-ins")

    # Set the path for the script-fu plug-in.  This value is ignored by
    #  the GIMP if the script-fu plug-in is never run.
    (script-fu-path "${gimp_dir}/scripts:${gimp_data_dir}/scripts")

Not adjustable in the pref. dialog

    # The tile cache is used to make sure the gimp doesn't thrash
    # tiles between memory and disk. Setting this value higher will
    # cause the gimp to use less swap space, but will also cause
    # the gimp to use more memory. Conversely, a smaller cache size
    # causes the gimp to use more swap space and less memory.
    # Note: the gimp will still run even if `tile-cache-size' is
    # set to 0. The actual size can contain a suffix of 'm', 'M',
    # 'k', 'K', 'b' or 'B', which makes the gimp interpret the
    # size as being specified in megabytes, kilobytes and bytes
    # respectively. If no suffix is specified the size defaults to
    # being specified in kilobytes.
    (tile-cache-size 10m)

    # Speed of marching ants in the selection outline
    #  this value is in milliseconds
    #  (less time indicates faster marching)
    (marching-ants-speed 300)

    # Set the number of operations kept on the undo stack
    (undo-levels 5)

    # Set the color-cube resource for dithering on 8-bit displays
    #  The 4 values stand for Shades of red, green, blue and grays
    #  Multiplying the # of shades of each primary color yields
    #  the total number of colors that will be allocated from the
    #  gimp colormap.  This number should not exceed 256.  Most of the
    #  colors remaining after the allocation of the colorcube
    #  will be left to the system palette in an effort to reduce
    #  colormap "flashing".
    (color-cube 6 6 4 24)

Not adjustable in the pref. dialog

    # Install a GIMP colormap by default -- only for 8-bit displays
    # (install-colormap)

    # Specify that marching ants for selected regions will be drawn
    #  with colormap cycling as opposed to redrawing with different stipple masks
    #  this color cycling option works only with 8-bit displays
    # (colormap-cycling)

    # Tools such as fuzzy-select and bucket fill find regions based on
    #  a seed-fill algorithm.  The seed fill starts at the initially
    # selected pixel and progresses in all directions until the
    # difference of pixel intensity from the original is greater than a
    # specified threshold ==> This value represents the default
    # threshold
    (default-threshold 15)

Not adjustable in the pref. dialog

    # There is always a tradeoff between memory usage and speed.  In most
    #  cases, the GIMP opts for speed over memory.  However, if memory is
    #  a big issue, set stingy-memory-use
    # (stingy-memory-use)

    # When zooming into and out of images, this option enables the
    #  automatic resizing of windows
    # (allow-resize-windows)

    # Context-dependent cursors are cool.  They are enabled by default.
    #  However, they require overhead that you may want to do without.
    #  Uncomment this line to disable them.
    # (no-cursor-updating)

    # Layer preview sizes:
    #  none:    no previews in layers dialog/layer selector
    #  small:   32x32
    #  medium:  64x64
    #  large:   128x128
    #  #:       #x#
    (preview-size small)

    # Tooltips
    #  Comment this out to disable the tooltips in the toolbox
    # (dont-show-tool-tips)

    # Controlling ruler visibility
    #  The default behavior is for rulers to be ON

    #  This can also be toggled with the View->Show Rulers command or shift+control+r
    # (dont-show-rulers)

Not adjustable in the pref. dialog

    # Ruler units
    #  The units of rulers can be one of: (pixels inches centimeters)
    #  The default is pixels
    (ruler-units pixels)

Not adjustable in the pref. dialog, but don't change it unless you know what you are doing.

    # Disable auto saving
    #  Just uncomment the line below...
    # (dont-auto-save)

Not adjustable in the pref. dialog, it doesn't do anything at the moment

    # Disable confirmation before closing an image without saving
    #  Just uncomment the next line
    # (dont-confirm-on-close)

Not adjustable in the pref. dialog

    # Setting the level of interpolation
    #  Uncommenting this line will enable cubic interpolation.
    #  By default, GIMP uses linear interpolation, which is faster, but has
    # .poorer quality
    # (cubic-interpolation)

    # Set the gamma correction values for the display
    #  1.0 corresponds to no gamma correction.  For most displays,
    #  gamma correction should be set to between 2.0 and 2.6

    #  Run the utility "gamma_correct" to determine appropriate values
    #  for your display.
    #
    # One important item to keep in mind:  Many images that you might
    #  get from outside sources will in all likelihood already be
    #  gamma-corrected.  In these cases, the image will look washed-out
    #  if the gimp has gamma-correction turned on.  If you are going
    #  to work with images of this sort, turn gamma correction off
    #  by removing this line, or setting the values to 1.0.
    #  gamma-correction 1.0
    #  gamma-correction 2.0
    #                 ___
    (gamma-correction 1.0)

Not adjustable in the pref. dialog, see the chapter 13 about how to make a gamma correction.

    # Set the manner in which transparency is displayed in images
    #  Transparency type can be one of:
    #    0: Light Checks
    #    1: Mid-Tone Checks
    #    2: Dark Checks
    #    3: White Only
    #    4: Gray Only
    #    5: Black Only
    #  Check size can be one of:
    #    0: Small
    #    1: Medium
    #    2: Large
    (transparency-type 1)
    (transparency-size 2)

The rest is paths for different plug-ins. Quite often you have to add a line like this to specify the path to auxiliary files for some new plug-ins. These lines are not adjustable in the pref. dialog

    (fractalexplorer-path "${gimp_data_dir}/fractalexplorer:${gimp_dir}/fractalexplorer")

    (gfig-path "${gimp_data_dir}/gfig:${gimp_dir}/gfig")

    (gflare-path "${gimp_dir}/gflares:${gimp_data_dir}/gflares")

### menurc

This is a personal only file located in your`.gimp` directory. This is where all your dynamically changed key-bindings end up. The easiest way to edit this file is to do the key-binding in Gimp. The altered short cuts will be written to this file as soon as you quit Gimp. If your key-bindings are totally screwed, then remove the file.

    [olof@olof olof]$ rm ~/.gimp/menurc

There is also a key-binding file that will make Gimp use Photoshop's key-bindings. It's located in the system-wide directory and it's called`ps-menurc`. If you want to use it, just copy it to your`.gimp` directory

    [olof@olof olof]$ cp /usr/local/share/gimp/ps-menurc ~/.gimp/

But why use Photoshop key-bindings when there are Gimp key-bindings?

### pluginrc

This file holds information about all the plug-ins available to Gimp. Do not edit this file! If Gimp starts to act spooky when it comes to plug-ins, then you can delete this file and Gimp will write a new one for you.

    [olof@olof olof]$ rm ~/.gimp/pluginrc

### gtkrc

This file is also a personal only file. It controls the behavior of the GTK tool kit that Gimp uses for its menus, tabfolders etc.... One of the few reasons to edit this file is to change the font that Gimp uses in the menus. You maybe want to make it bigger or smaller. Here is an extract:

    # style <name> [= <name>]
    # {
    #   <option>
    # }
    #

    # widget <widget_set> style <style_name>
    # widget_class <widget_class_set> style <style_name>

    style "ruler"
    {
      font = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*"
    }

    style "default"
    {
      font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
    }

    #style "lsystem_rules"
    #{
    #  font = "-*-courier-medium-r-normal--*-100-100-100-m-*-*-*"
    #}

    widget_class "*Ruler*" style "ruler"
    widget_class "*" style "default"

To understand how to change the font line, please read chapter 10 and 40. This file is otherwise quite self-explaining.

## Installing a new Gimp

If you are installing a new version of Gimp, please remember to remove your personal `rc`files. We mostly do this by renaming our `.gimp` directory to`.gimp.old.` Then we can always open our old files and cut and copy special file modifications.

Generated by fmtoweb (v. 2.9c) written by Peter G. Martin <peterm@zeta.org.au> Last modified: 20 May 1998