FLUXBOX-KEYS(5) | Fluxbox Manual | FLUXBOX-KEYS(5) |
NAME¶
fluxbox-keys - keyboard shortcuts configuration for fluxbox(1)
SYNOPSIS¶
~/.fluxbox/keys
SYNTAX¶
Variable parameters are shown in emphasis: argument
Optional parameters are shown in square brackets: [argument]
All other characters shown are required verbatim. Whitespace is required where shown, but it is fine to add more whitespace.
DESCRIPTION¶
The keys file defines the keyboard shortcuts for fluxbox(1).
You can customize fluxbox’s key handling through the ~/.fluxbox/keys file. The file consists of lines of the basic format:
[modifiers] key :'command' [arguments ...]
The space between the key and the : before the command is mandatory.
All modifiers and commands are case-insensitive. Some command arguments (especially those that will be passed to the shell) are case-sensitive. Some key names are case-sensitive.
Lines beginning with a # or ! are considered comments and are unread by fluxbox.
You will need to “reload” fluxbox after editing the keys file so it picks up your change.
MODIFIERS¶
You can get a list of possible modifiers by calling ‘xmodmap -pm’. This also shows you to which keys the modifiers are mapped, but the following modifiers are most commonly used:
Shift Control Mod1 Mod4
where Mod1 is the Alt key on the PC keyboard and Mod4 is usually a key branded with a familiar company logo.
There are also some special modifiers that refer to mouse button events
OnDesktop
OnToolbar
OnWindow
OnTitlebar
OnTab
Double
Combining Modifiers¶
To combine two or more modifiers, just list them (space-delimited) in any order.
KEYS¶
You may specify a key by its key name (for example, a or space) or by its numeric keycode (for example, 38 or 0xf3).
If you don’t know the name of a key, you can run xev(1) in a terminal, push the key, and see the name in the output. If you have some "special" keys that do not produce a key name in the output of xev(1), you can just use the keycode (NOT the keysym!) in your keys file.
Commands can also be bound to mouse events (N denotes the number of the button, eg. 1 is the primary button, 4/5 are the wheel buttons):
MouseN
ClickN
MoveN
There are some special "keys" that let you bind events to non-keyboard events:
ChangeWorkspace
Warning
Use caution with this event! For example, do NOT bind this to any action that changes your current workspace. If you break your fluxbox with this feature, you get to keep the pieces.
CHAINING¶
Key bindings can be chained in a fashion similar to Emacs key bindings using the syntax:
modifiers-1 key-1 modifiers-2 key-2 :'command' [arguments ...]*
To abort a chained command part-way through typing it, press the <ESC> key.
To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox.
Control c Control x :Quit
KEYMODES¶
A specific set of key mappings can be activated and de-activated on-the-fly using what are called keymodes. The syntax to define a mapping in a keymode is:
keymode: modifiers key :'command' [arguments ...]
Where keymode is any alpha-numeric string name.
When this keymode is activated (see the KeyMode command below), all bindings prefaced by that keymode name become active (and all other keybindings will be deactivated) until the keymode changes again.
COMMANDS¶
Some commands have multiple names which are shown below as
Related commands have been grouped below as
The commands are broken up into sections as follows
Mouse Commands¶
These commands may only be bound to mouse buttons (plus modifiers), not keystrokes. In all cases, the action finishes when the mouse button is released.
StartMoving
StartResizing [corner]
By default corner is BottomRight, but may be overridden with one of:
If NearestCornerOrEdge is specified the size of the corner can also be specified to be the larger of one or two following numbers: [pixel-size [percent-size]] or percent-size%, where percent-size is the percentage of half the window width or height. If no size is given, it defaults to 50 pixels and 30%.
StartTabbing
ActivateTab
Window Commands¶
These commands ordinarily affect only the currently focused window. The OnWindow modifier and ForEach command may affect the window that is used.
Minimize | MinimizeWindow | Iconify
Maximize | MaximizeWindow
MaximizeHorizontal / MaximizeVertical
Fullscreen
Raise / Lower
RaiseLayer / LowerLayer [offset]
SetLayer layer
Close
Kill | KillWindow
Shade | ShadeWindow
ShadeOn / ShadeOff
Stick | StickWindow
SetDecor decor
ToggleDecor
NextTab / PrevTab
Tab number
MoveTabRight / MoveTabLeft
DetachClient
ResizeTo width[%] height[%]
Resize delta-width[%] delta-height[%]
ResizeHorizontal delta-width[%] / ResizeVertical delta-height[%]
MoveTo x[%] y[%] [anchor]
If either x or y is set to \*, that coordinate will be ignored, and the movement will only take place in one dimension.
The default anchor is the upper left corner, but this may be overridden with one of:
Move delta-x delta-y
MoveRight d / MoveLeft d / MoveUp d / MoveDown d
TakeToWorkspace workspace / SendToWorkspace workspace
TakeToNextWorkspace [offset] / TakeToPrevWorkspace [offset]
SendToNextWorkspace [offset] / SendToPrevWorkspace [offset]
SetAlpha [alpha [unfocused-alpha]]
Putting a + or - in front of the value adds or subtracts from the current value. A plain integer sets the value explicitly.
no arguments
one argument
two arguments
SetHead number
SendToNextHead [offset] / SendToPrevHead [offset]
SetXProp PROP=value
Workspace Commands¶
These commands affect the entire workspace (or "desktop" as it is sometimes called).
AddWorkspace / RemoveLastWorkspace
NextWorkspace [n] / PrevWorkspace [n] / RightWorkspace [n] / LeftWorkspace [n]
Workspace number
NextWindow [{options}] [pattern] / PrevWindow [{options}] [pattern]
options is one or more of the following, space delimited:
static
groups
If pattern arguments are supplied, only windows that match all the patterns are considered - all others are skipped. See the section CLIENT PATTERNS below for more information.
This pair of commands has a special side-effect when the keybinding used has a modifier - It will temporarily raise the cycled window to the front so you can see it, but if you continue holding down the modifier and press the key again (For example, keep holding "Alt" while you tap the "Tab" key a few times), fluxbox will lower the window again when you move on to the next one. This allows you to preview the windows in order, but does not change the order in doing so.
NextGroup [{options}] [pattern] / PrevGroup [{options}] [pattern]
GotoWindow number [{options}] [pattern]
Activate [pattern] | Focus [pattern]
Attach pattern
FocusLeft / FocusRight / FocusUp / FocusDown
ArrangeWindows pattern / ArrangeWindowsVertical pattern / ArrangeWindowsHorizontal pattern
ArrangeWindowsStackLeft pattern / ArrangeWindowsStackRight pattern
ArrangeWindowsStackTop pattern / ArrangeWindowsStackBottom pattern
ShowDesktop
Deiconify mode destination
Where mode may be one of:
All
AllWorkspace
Last
LastWorkspace (default)
And destination may be one of:
Current (default)
OriginQuiet
SetWorkspaceName name / SetWorkspaceNameDialog
CloseAllWindows
Menu Commands¶
These commands open or close fluxbox popup menus. For more information on what these menus contain or how to configure them, see fluxbox(1).
RootMenu
WorkspaceMenu
WindowMenu
ClientMenu [pattern]
CustomMenu path
HideMenus
Window Manager Commands¶
These commands affect the Window Manager, or more than one window.
Restart [path]
Quit | Exit
Reconfig | Reconfigure
SetStyle path
ReloadStyle
ExecCommand args ... | Exec args ... | Execute args ...
CommandDialog
SetEnv name value | Export name=value
SetResourceValue resourcename resourcevalue | SetResourceValueDialog
Special Commands¶
These commands have special meanings or behaviors.
MacroCmd {command1} {command2} {command3} ...
MacroCmd {MoveTo 0 0} {ResizeTo 1280 800}
Delay {command} [microseconds]
ToggleCmd {command1} {command2} ...
BindKey keybinding
KeyMode keymode [return-keybinding]
ForEach {command} [{condition}] | Map {command} [{condition}]
If {condition} {then-command} [{else-command}] | Cond {condition} {then-command} [{else-command}]
Conditions¶
These special commands are used to match windows conditionally. They are commonly used by the If and ForEach command.
Matches pattern
If your key binding uses the OnWindow modifier, it matches against the window you clicked, not the currently focused window.
To check other windows besides the currently focused one, see the Every and Some conditions below.
Some condition
Every condition
Not condition
And {condition1} {condition2} [{condition3} ...]
Or {condition1} {condition2} [{condition3} ...]
Xor {condition1} {condition2} [{condition3} ...]
CLIENT PATTERNS¶
Many of the more advanced commands take a pattern argument, which allows you to direct the action at a specific window or set of windows which match the properties specified in the pattern.
A pattern looks like this
Match definitions are enclosed in parentheses (...), and if no propertyname is given then Name is assumed. The regexp can contain any regular expression, or the special value [current], which matches the corresponding value of the currently focused window. See regex(7) for more information on acceptable regular expressions.
propertyname is not case sensitive, whereas the regexp is.
If you specify multiple (pattern) arguments, this implies an AND condition - All specified patterns must match.
You can use = to test for equality or != to test for inequality.
The following values are accepted for propertyname
Name
Class
Title
Role
Transient
Maximized
MaximizedHorizontal
MaximizedVertical
Minimized
Fullscreen
Shaded
Stuck
FocusHidden
IconHidden
Urgent
Workspace
WorkspaceName
Head
Layer
Screen
@XPROP
Matches any windows with the CLASSNAME of "xterm".
(xterm)
Matches any windows with the same CLASSNAME as the currently focused window.
(Name=[current])
Matches any windows on the same head as the mouse but on a different layer than the currently focused window.
(Head=[mouse]) (Layer!=[current])
Matches any windows having a xproperty named FOO with "bar" in it.
(@FOO=.*bar.*)
FILES¶
~/.fluxbox/keys
/usr/X11R6/include/X11/keysymdef.h
/usr/X11R6/lib/X11/XKeysymDB
RESOURCES¶
session.keyFile: location
ENVIRONMENT¶
Remember that ExecCommand command can take advantage of other environment variables if they are set before fluxbox is started, or via the Export or SetEnv commands. For example, if $TERM is set, it could be use like this:
Mod1 x :ExecCommand $TERM
For more information about environment variables, see your shell’s manual.
EXAMPLES¶
Here are some interesting and/or useful examples you can do with your keys file.
# Mod4+drag moves a window OnWindow Mod4 Mouse1 :StartMoving # If any xterm windows are open, cycle through them. If none are open, open # one: Mod4 t :If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm} # Set a different wallpaper on every workspace: ChangeWorkspace :Exec fbsetbg ~/.fluxbox/bg$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}').png # Focusses the next window with it's xproperty 'PROP' set to 'foo' Mod4 p Mod4 Tab :NextWindow (@PROP=foo)
AUTHORS¶
SEE ALSO¶
AUTHOR¶
Jim Ramsay <i.am@jimramsay.com>
08 February 2015 | fluxbox-keys.txt |