__TOC__
플럭스박스 메뉴 문법은 이해하기 매우 쉽고 메뉴 수정을 하기 위해 알아야 할 것도 단지 몇 개다.
첫 번째가 가장 기본 문법이다:
[begin]
[exec] (term) {xterm}
[reconfig] (Reload config)
[exit] (Exit)
[end]
이것은 아주 단순한 메뉴를 줄 것이다. xterm, 설정 다시 읽어들이기, 재시작 그리고 종료. 플럭스박스가 IMLIB2를 지원하게 컴파일됐고 terminal.png 아이콘이 /usr/share/pixmaps 폴더에 있다면 메뉴에서 또한 아이콘을 볼 것이다.
이 명령을 실행하라
fluxbox -i
명령의 출력 결과가 플럭스박스에서 함께 컴파일된 것들의 목록이다, 목록에
-IMLIB2
나
-XPM
이 있다면 이것을 지원하지 않게 컴파일되었다는 뜻이다 (-에 주목할 것). 플럭스박스에서 아이콘 지원을 위해 필요한 것들은: IMLIB2 (png 아이콘을 쓸 수 있게 한다) 그리고 XPM (xpm 아이콘을 쓸 수 있게 한다)이다. 메뉴뿐만 아니라 스타일에서도 마찬가지. XPM (- 없이)만 보인다면, .xpm 아이콘을 쓸 수 있고, IMLIB2가 있다면 .png (혹은 .jpg 등등, 물론 .xpm도)를 쓸 수 있다.
아이콘 경로는 절대 경로여야 한다, 이렇게
위 예시처럼, 문법은 거의가 이런 식이다
[tag] (제목 또는 파일명) {명령 또는 파일명}
<아이콘 파일명>
지원되는 태그들이다 (man 페이지에서 발췌):
[begin] (label)
This tells Fluxbox to start parsing the menu file. This tag is required
for Fluxbox to read your menu file. If it cannot find it, the system
default menu is used in it's place.
[end]
This tells Fluxbox that it is at the end of a menu. This can either be a
submenu or the main root menu. There must be at least one of these tags in
our menu to correspond to the required [begin] tag.
[exec] (label) {command}
Inserts a command item into the menu. When you select the menu item from
the menu, Fluxbox runs command.
[exit] (label)
Inserts an item that shuts down and exits Fluxbox. Any open windows are
reparented to the root window before Fluxbox exits.
[include] (file-or-directory-name)
Parses the file specified by filename inline with the current menu. The
filename can be the full path to a file or it can begin with ~/, which
will be expanded into your home directory. If the path is a directory,
then all files in the directory are included.
[nop] (label)
Insert a non-operational item into the current menu. This can be used to
help format the menu into blocks or sections if so desired. This tag does
support a label, but one is not required in which case a blank item will
be used instead.
[separator]
This will create a nice separation line. Useful for splitting up sections
in a pretty way.
[style] (label) {filename}
This tells Fluxbox to insert an item that, when selected, reads style file
named filename and apply the new textures, colors and fonts to the current
running session.
[stylesmenu] (directory)
Reads all filenames from the specified directory, assuming that they are
all valid style files, and creates menu items in the current menu for
every filename, that, when selected by the user will apply the selected
style file to the current session. The labels that are created in the menu
are the filenames of the style files.
[stylesdir] (label) {directory}
Creates a submenu entry with label (that is also the title of the new
(submenu), and inserts in that submenu all filenames in the specified
directory, assuming that they are all valid style files (directories are
ignored) in the same way as the [stylesdir] command does. Both [stylesdir]
and [stylesmenu] commands make it possible to install style files without
editing your init file.
[submenu] (label) {menutitle}
This tells Fluxbox to create and parse a new menu. This menu is inserted
as a submenu into the parent menu. These menus are parsed recursively, so
there is no limit to the number of levels or nested submenus you can have.
The title for the new menu is optional, if none is supplied, the new
menu's title is the same as the item label. An [end] tag is required to
end the submenu.
[reconfig] (label)
When selected this item re-reads the current style and menu files and
applies any changes. This is useful for creating a new style or theme,
as you don't have to constantly restart Fluxbox every time you save your
style. However, Fluxbox automagically rereads the menu whenever it
changes.
[restart] (label) {command}
This tells Fluxbox to restart. If command is supplied, it shuts down and
runs the command (which is commonly the name of another windowmanager).
If the command is omitted, Fluxbox restarts itself.
[config] (label)
Inserts a Fluxbox native submenu item, containing numerous configuration
options concerning window placement, focus style, window moving style,
etc.
[wallpapers] (directory)
This allows you to list your backgrounds. This tag is built in to use
fbsetbg(1) and allows you to simply click on an image to set your
wallpaper. See? Fluxbox makes it easy…
[workspaces] (label)
This tells Fluxbox to insert a link to the workspaces menu directly into
your menu. This is handy for those users who can't access the workspace
menu directly (e.g. if you don't have a 3 button mouse, it is rather hard
to middle click to show the workspace menu).
Long story short. Use fluxMenu. It is still under development but works just fine. There is also Fluxbox Menu Editor. Another editor for fluxbox.