Editing the apps file
From Fluxbox-wiki
Contents |
How to edit the apps file
One thing to know is: if you run fluxbox 0.9.13 or lower, when you edit the apps file while running fluxbox, on a restart or a reload of the config all changes will be reset to the previous. For higher versions of fluxbox there is no problem.
A workaround for this problem (when you use on old version of fluxbox):
- modify the file and save your changes
- chmod 444 ~/.fluxbox/apps
- restart fluxbox
- chmod 744 ~/.fluxbox/apps
The easiest way for most issues is to right-click the window titlebar and use the "Remember Options" combined with the "save on close" entry to make them permanent in the apps file. The most common problems can be solved via this menu such as the default workspace to open the application on or the position/size.
For the "fine tuning" of these settings or to add some special options the apps file needs to be edited while not running fluxbox. Therefore simple exit via the rootmenu and edit ~/.fluxbox/apps by hand.
Apps file entries
The format for the apps file is:
[app] (app-name) {count - optional}
[Property1] {value1}
[Property2] {value2}
...
[end]
Each app-name can be a string or a regular expression. By default the name is matched against a windows WM_CLASS property (the first string in it, called the "instance"). You can match against the title, instance name (default), class name, or role (the WM_WINDOW_ROLE property) by explicitly specifying it. You can also specify multiple matches, which must ALL match for the properties to be applied. If a count is supplied in curly brackets at the end of the app line, then the entry will only match at most count at any time (default is to match all matching windows). The most common way is the apps name which can be found out by executing
xprop WM_CLASS|cut -d \" -f 2|xmessage -file - -center
and clicking onto the desired window.
Some examples of the several others are:
- match a standard xterm
[app] (xterm)
... Properties ...
[end]
- match an xterm started like:
xterm -name myshell
[app] (myshell)
... Properties ...
[end]
- match any one Firefox window (the instance name is "Gecko")
[app] (class=Firefox-bin) {1}
... Properties ...
[end]
- match the gaim buddy list window
[app] (role=buddy_list)
... Properties ...
[end]
- match an rdesktop window to a particular host
[app] (title=rdesktop - hostname.*)
... Properties ...
[end]
The following are the properties that can be defined in each [app] entry. Each name must be enclosed in square brackets, and the value is generally in curly brackets:
- [Workspace] {0-N}
- Forces the application to open on the workspace specified. Workspaces are set by number, beginning with 0.
- [Dimensions] {Width Height}: Open the application with the specified width and height, in pixels.
- [Position] (refspot)) {X Y}
- Position the application at a particular spot:
- WINCENTER
- CENTER
- UPPERLEFT
- UPPERRIGHT
- LOWERLEFT
- LOWERRIGHT
- You can optionally specify what X and Y are relative to. By default the upper left corner is placed at screen coordinates (X, Y). If you specify LOWERRIGHT, then the lower right corner of the window is positioned (X,Y) pixels from the lower right of the screen. Note that CENTER puts the top left corner of the window relative to the center of the screen (WINCENTER acts like the rest - positions the center of the window relative to the center of the screen).
- [Layer] {Layernum}
- Specify the layer to open the window on (by number). Each layer has a number. The named ones are:
- 2 - AboveDock
- 4 - Dock
- 6 - Top
- 8 - Normal
- 10 - Bottom
- 12 - Desktop
- [Shaded] {yes|no}
- The window is started shaded, or not.
- [Tab] {yes|no}
- Whether this window can be tabbed with others.
- [IconHidden] {yes|no}
- Hides the app from the icon bar
- [FocusHidden] {yes|no}
- Hides the app from the window cycling list used Next/PrevWindow key bindings.
- [Hidden] {yes|no}
- is both [IconHidden] plus [FocusHidden]
- [Deco] {NONE|NORMAL|TOOL|TINY|BORDER|TAB}
- Specify the decoration state. There are several predefined dec- oration sets:
- NORMAL - standard decorations
- NONE - no decorations
- BORDER - like NONE except keep the X window border
- TINY - titlebar with an iconify button
- TOOL - titlebar only
- TAB - like NONE except show external tabs only (in SVN version only)
- A bitmask can also be used for fine-grained control. The bits are (from "1" to 1<<10): titlebar, handle/grips, border, iconify button, maximize button, close button, menu enabled, sticky button, shade button, tabbing enabled, focus enabled.
- [Sticky] {yes|no}
- Whether the window is initially stuck or not.
- [Jump] {yes|no}
- Jump to workspace. This one is only useful if `Workspace' is set too. The workspace is changed to the workspace * containing the application being launched.
- [Close] {yes|no}
- Save settings on close. By default, application settings are not saved when a window is closed. Set this option if * you want previous settings to be saved when the window is closed.
The apps file also allows you to specify applications that should be started. Could be used to specify the screen, not the workspace, on which the application should be started. Startup is not yet setable by menu.
Finally, you can set windows to group together by using the `apps' file. This is achieved with either regular expressions using:
[app] (property=expr) ... {number}
Property can be one of the following tags:
- name - the name of the window (the first field of WM_CLASS)
- class - class of the window (the second field of WM_CLASS)
- title - title of the window ( WM_NAME property)
- role - role of the window (the WM_WINDOW_ROLE property)
If no `property' is specified, the name property is assumed. You can find out the value for these fields for a particular window by running xprop(1).
Here an example of how an apps file can look like:
[startup] {xterm}
# match anything ending with term, up to 2 instances
[app] (.*[tT]erm) {2}
# match anything with `gaim' in the title
[app] (title=.*gaim.*)
[app] (kate)
[Dimensions] (WINCENTER) {1022 747}
[Position] {0 0}
[Close] {yes}
[end]
[app] (konqueror)
[Workspace] {1}
[Dimensions] {1006 749}
[Position] {16 0}
[Jump] {yes}
[end]
# start all aterms without decorations
[app] (aterm)
[Deco] {NONE}
[end]
Grouping apps via the apps file
You can also place a [group] tag around several [app] tags, with an [end] tag to indicate the end of the group. You should not use an [end] tag for individual apps in a group. You can specify dimensions, position, etc. for the group as for normal app entries.
Fluxbox also can group programs using the file ~/.fluxbox/groups . NOTE: the groups file is deprecated since version 0.9.1 in favor of grouping using the `apps' file, since it is much more powerful. The groups file only groups windows on the same workspace, whereas the apps file searches all workspaces by default. To replicate the groups file's behavior with the apps file, use `[group] (workspace)', which was introduced in version 1.0rc3.
Here is a short example of an apps file:
# a group with all windows called "special-term",
# appears on layer 4 (bottom)
[group]
[app] (special-term)
[Layer] {4}
[end]
# a group that only looks for windows on the current workspace
[group] (workspace)
[app] (firefox-bin) (title=.*Mozilla Firefox.*)
[app] (opera)
[Dimensions] {800 600}
[Position] (UPPERRIGHT) {0 0}
[end]

