Copyright (C) 2000-2012 |
GNU Info (sawfish.info)ThemesThemes ====== Themes and frame styles are currently almost synonymous, the slight difference being that themes provide a mechanism for loading frame styles from the filing system as they are required. Although it is possible that themes may include other user-interface settings in a later version, at the moment it seems unlikely. When a frame style is requested, if it is not already available (i.e. if the `add-frame-style' function hasn't been called for that style) then the window manager will attempt to load a theme of the same name from the filing system. Each theme is stored in a directory; this directory must have the same name as the name of the theme itself. Within this directory there must be a Lisp script named `theme.jl' or `theme.jlc'. This script will be evaluated, it should provide a frame style of the same name as the theme (by calling `add-frame-style'). While the theme script is evaluating the `image-load-path' variable is set to include the theme directory as its first element. This ensures that any image files stored in the directory can be loaded using the `make-image' function. Since rep has no module system, any global variables defined within the theme must be prefixed by the name of the theme to ensure their uniqueness. For example, in the theme `foo', a variable `bar' would actually be called `foo:bar'. In most cases however, rep's lexical scoping can be used to avoid declaring any global variables or functions, the only usual exception is when declaring customization options with `defcustom'; these must be globally visible. Since themes are generally passed around very casually, sawfish evaluates all theme code in a very restricted environment; the idea being that themes should only be able to affect the look of the window manager. Despite this, it is still possible for malicious themes to lock, and possibly crash, the window manager; in the first case sending a `SIGINT' signal may unblock it. Hopefully themes are unable to affect the rest of the user's environment, but there are no guarantees... - Variable: theme-load-path A list of directory names, provides the search path for locating theme directories. By default this includes the user's theme directory and the system theme directory. - Variable: user-theme-directory The name of the user's theme directory, by default `~/.sawfish/themes'. - Variable: system-theme-directory The name of the system theme directory. automatically generated by info2www version 1.2.2.9 |