[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
StumpWM is controlled entirely by keystrokes and Lisp commands. It mimics GNU Screen’s keyboard handling. StumpWM’s default prefix key is C-t.
2.1 List of Default Keybindings | ||
2.2 Binding Keys | ||
2.3 Modifiers |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following is a list of keybindings.
Select the window with the corresponding digit d
Pull the window with the corresponding digit d into the current frame
Go to the next window in the window list
Go to the previous window in the window list
Go to a window by name
Select a window from a list and focus the window.
Abort the current command. This is useful if you accidentally hit C-t
List all the windows
Display information about the current window.
Select a frame by number
Split current frame vertically
Split current frame horizontally
Sends a kill message to the current frame and the running program.
Kills the current frame and running program; like a kill -9
.
Run an X terminal; by default xterm
Run Emacs or raise it if it is already running.
Sends a C-t to the frame; this is useful for applications like Firefox which make heavy use of C-t (in Firefox’s case, for opening a new tab). This is similar to how GNU screen uses C-a a.
Prints out a list of the windows, their number, and their name.
Banish the mouse point to the lower right corner of the screen.
Display the current time and date, much like the Unix command date
.
Switch to the last window to have focus in the current frame.
Prompt for a shell command to run via ‘/bin/sh’. All output is discarded.
If the screen is split into multiple frames, one split will be undone. If there is only one split, the effect will be the same as C-t Q.
If the screen is split into multiple frames, focus shifts to the
next
frame, where it cycles to the right and then down; analogous
to C-x o in Emacs.
Display “Current Frame” in the frame which has focus.
Opens the input box. StumpWM commands can be run from here, and the input history moved through.
Opens the input box, but all things typed in here will be sent to the Common Lisp interpreter where they will be ran as Lisp programs; thus, input should be valid Common Lisp.
The help.
Hide all frames and show the root window.
Removes all splits and maximizes the frame with focus.
Shift focus to an adjacent frame in the specified direction. C-t Up will shift focus up, if possible, C-t Down will shift downwards, etc.
Prints out the version of the running StumpWM.
Toggle the mark on the current window
Display the last message. Hitting this keybinding again displays the message before that, and so on.
redisplay the current window and force it to take up the entire frame.
Display all groups and windows in each group. For more information see Groups.
Jump to the corresponding group n. C-t F1 jumps to group 1 and so on.
Show the list of groups.
Create a new group.
Go to the next group in the list.
Go to the next group in the list and bring the current window along.
Go to the previous group in the list.
Go to the previous group in the list and bring the current window along.
Select a group by name or by number.
Select a group from a list and switch to it.
Move the current window to the specified group.
Kill the current group. All windows are merged into the next group.
Change the current group’s name.
Go to the group with digit d. C-t g 1 jumps to group 1 and so on.
Make frames the same height or width in the current frame’s subtree.
Describe the specified key binding.
Describe the specified function.
Describe the specified variable.
List all key sequences that are bound to the specified command
Describe the specified command.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Add a keybinding mapping for the key, key, to the command, command, in the specified keymap. If command is nil, remove an exising binding. For example,
(stumpwm:define-key stumpwm:*root-map* (stumpwm:kbd "C-z") "echo Zzzzz...") |
Now when you type C-t C-z, you’ll see the text “Zzzzz...” pop up.
Clear the key binding in the specified keybinding.
This compiles a key string into a key structure used by ‘define-key’, ‘undefine-key’, ‘set-prefix-key’ and others.
Change the stumpwm prefix key to KEY.
(stumpwm:set-prefix-key (stumpwm:kbd "C-M-H-s-z")) |
This will change the prefix key to <Control> + <Meta> + <Hyper> + <Super> + the <z> key. By most standards, a terrible prefix key but it makes a great example.
Create an empty keymap. If you want to create a new list of bindings in the key binding tree, this is where you start. To hang frame related bindings off C-t C-f one might use the following code:
(defvar *my-frame-bindings* (let ((m (stumpwm:make-sparse-keymap))) (stumpwm:define-key m (stumpwm:kbd "f") "curframe") (stumpwm:define-key m (stumpwm:kbd "M-b") "move-focus left") m ; NOTE: this is important )) (stumpwm:define-key stumpwm:*root-map* (stumpwm:kbd "C-f") '*my-frame-bindings*) |
This is the keymap by default bound to C-t. It is known as the prefix map.
The top level key map. This is where you’ll find the binding for the prefix map.
The keymap that group related key bindings sit on. It is bound to C-t g by default.
Hang a key binding off the escape key.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Many users have had some difficulty with setting up modifiers for StumpWM keybindings. This is caused by a combination of how StumpWM handles modifiers and the default modifiers list for many users’ X servers.
This is most likely caused by having the Hyper and Super keys listed as the same modifier in the modifier list.
$ xmodmap xmodmap: up to 3 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x6d) mod1 Alt_L (0x40), Alt_R (0x71), Meta_L (0x9c) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x7f), Hyper_L (0x80) mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c) |
The problem is in the line beginning with “mod4”. The way to set up
the modifier list correctly is to have just the Super key as the mod4
modifier. The following xmodmap
commands will do just that.
# clear out the mod4 modifier $ xmodmap -e 'clear mod4' $ xmodmap xmodmap: up to 3 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x6d) mod1 Alt_L (0x40), Alt_R (0x71), Meta_L (0x9c) mod2 Num_Lock (0x4d) mod3 mod4 mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c) # add Super as a mod4 modifier $ xmodmap -e 'add mod4 = Super_L' $ xmodmap xmodmap: up to 3 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x6d) mod1 Alt_L (0x40), Alt_R (0x71), Meta_L (0x9c) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x73), Super_L (0x7f) mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c) |
You can automate this by storing the commands in a file and calling xmodmap when you start your X session.
$ cat ~/.Xmodmap clear mod4 add mod4 = Super_L |
If you use startx
, modify your ‘~/.xsession’ or ‘~/.xinitrc’ file.
$ cat ~/.xsession #!/bin/sh xmodmap ~/.Xmodmap exec /usr/bin/stumpwm |
If you use a graphical login manager (GDM, KDM, etc.), your ‘~/.Xmodmap’
file should be fed to xmodmap
when you log in. FIXME: verify this.
If you have no Meta keys defined (see the output of the xmodmap
command), then StumpWM will treat the M- prefix in keybindings to
mean Alt. However, if there are Meta keys defined, then the M-
prefix refers to them, and the A- prefix refers to Alt.
Most users will simply use M- to refer to their Alt keys. However, users that define separate Meta and Alt keys will use M- to refer to the former, and A- to refer to the latter.
To set up a Hyper key, you need to do two things: bind a physical key to be a Hyper key, and add that key to the modifiers list.
The following example shows how to bind the control key at the bottom-left of most keyboards to be Hyper. This is useful if you’ve made Caps Lock into a control key, and have no use for the bottom-left key.
$ xmodmap -e 'keycode 37 = Hyper_L' $ xmodmap -e 'clear mod5' $ xmodmap -e 'add mod5 = Hyper_L' |
To use a different key for Hyper, replace the keycode “37” above.
Use the xev
program to see the keycode that any physical key has.
Refer to the section above on setting up the Super key to see how to
automate setting the Hyper key when you start X.
Now you can use H- as a prefix in StumpWM bindings.
(define-key *top-map* (kbd "H-RET") "fullscreen") (define-key *top-map* (kbd "H-Left") "gprev") (define-key *top-map* (kbd "H-Right") "gnext") (define-key *top-map* (kbd "H-TAB") "other") |
Since essentially no programs have Hyper bindings, you can safely bind commands to the *top-map*.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by David Bjergaard on November 1, 2014 using texi2html 1.82.