[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

6. The Mode Line

The mode line is a bar that runs across either the top or bottom of a head and is used to display information. By default the mode line displays the list of windows, similar to the output C-t w produces.

Alternatively, external panel applications such as the GNOME panel and KDE's kicker may be used. Simply starting one of these programs is enough to set it as the mode line of the head it would like to be on (if the panel is Xinerama aware) or whichever head is available. In order to avoid problems displaying menus, configure your panel application for positioning at the top or bottom of the head rather than relying on *mode-line-position*

The mode line can be turned on and off with the mode-line command or the lisp function stumpwm:toggle-mode-line. Each head has its own mode line. For example:

 
;; turn on/off the mode line for the current head only.
(stumpwm:toggle-mode-line (stumpwm:current-screen) (stumpwm:current-head))

The mode line is updated after every StumpWM command.

To display the window list and the current date on the modeline, one might do the following:

 
(setf stumpwm:*screen-mode-line-format*
      (list "%w | "
            '(:eval (stumpwm:run-shell-command "date" t))))

(stumpwm:run-shell-command "date" t) runs the command date and returns its output as a string.

Command: mode-line

A command to toggle the mode line visibility.

Function: toggle-mode-line SCREEN HEAD &OPTIONAL (FORMAT (QUOTE *SCREEN-MODE-LINE-FORMAT*))

NIL

Variable: *screen-mode-line-format*

This variable describes what will be displayed on the modeline for each screen. Turn it on with the function TOGGLE-MODE-LINE or the mode-line command.

It is a list where each element may be a string, a symbol, or a list.

For a symbol its value is used.

For a list of the form (:eval FORM) FORM is evaluated and the result is used as a mode line element.

If it is a string the string is printed with the following formatting options:

%h

List the number of the head the mode-line belongs to

%w

List all windows in the current group windows using *window-format*

%W

List all windows on the current head of the current group using *window-format*

%g

List the groups using *group-format*

The following variables control the color, position, and size of the mode line.

Variable: *mode-line-position*

Specifies where the mode line is displayed. Valid values are :top and :bottom.

Variable: *mode-line-border-width* 1

NIL

Variable: *mode-line-pad-x*

NIL

Variable: *mode-line-pad-y*

NIL

Variable: *mode-line-background-color*

NIL

Variable: *mode-line-foreground-color*

NIL

Variable: *mode-line-border-color*

NIL

Variable: *mode-line-timeout*

The modeline updates after each command, when a new window appears or an existing one disappears, and on a timer. This variable controls how many seconds elapse between each update. If this variable is changed while the modeline is visible, you must toggle the modeline to update timer.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 9 Octobre 2008 en utilisant texi2html 1.78.