dvtm
dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs like vim, mutt, cmus or irssi.
News
- dvtm-0.4.1 released (10.05.2008).
- Cursor key mode switching (this fixes arrow keys in vim)
- Characters following an escape are passed to the underlying application, this fixes ALT+<n> key combination as used by irssi
- A hack to make the keypad sort of work with putty
- Mouse support is now compile time selectable
- Destroy clients when an IO-error occurs
- Correct signal handling (save and restore errno)
- Destroy clients cleanly, prevent zombies
- Added a note about copy & paste to the manual page (use SHIFT while selecting or pasting text)
- Some source code formatting fixes
- dvtm-0.4 released (17.02.2008).
- Only draw borders where necessary (titlebar + vertical separator)
- Respect cursor visibility of apps running within dvtm
- Autoquit feature, dvtm quits when the last shell is closed
- Support for window title escape sequence (xtermset -T title)
- Links against ncurses by default
- Compilation fix for NetBSD (hopefully)
- Some bugfixes and code cleanups
- dvtm-0.3 released (12.01.2008).
- Possibility to specify applications which should be launched after dvtm startup in config.h and on the command line.
- New commands redraw, escapekey and killclient.
- Allow commands to take multiple arguments. This changed how key bindings are defined in config.h. Currently only create uses this, the second argument is the window title.
- Mouse support configurable via config.h.
- Allow key bindings with no modifier prefix if modifier is set to zero.
- Make it possible to send the modifier to the underlying application by doubling it (when you press ^g ^g the underlying app will receive ^g).
- Configurable status bar position.
- Better UTF-8 locale detection.
- Various code cleanups.
- Some kind of manual page.
- dvtm-0.2 released (29.12.2007).
- use madtty instead of librote for terminal emulation.
- a select(2) driven event loop which should reduce CPU usage.
- ability to minimize windows (only the titlebar will be shown) the corresponding function for use with a key binding is toggleminimize. Functions to select the next/previous non minimized window were also added, they are called focus{next,prev}nm.
- an optional status bar which reads from a named pipe, see the included dvtm-status script for a use case.
- a new fullscreen layout
- sigterm handler, which leaves curses mode. Useful when you kill dvtm so you don't have to type reset.
- Portability: i have compiled dvtm on Open and FreeBSD, there are some minor issues (OpenBSD uses some ugly window borders and the selected window border isn't red, on FreeBSD only part of the window title is red not the whole window border). Patches welcome.
- dvtm-0.1 released (21.12.2007).
- new default modifier (CTRL+G)
- better performance (lower default redraw timeout, other fixes)
- settimeout function which allows to set the redraw timeout via key bindings.
- display the window number in the title bar for easier selection with MOD-n
- new command line switch (-m), which allows to specify the modifier at runtime. This is useful when running dvtm recursively (dvtm within dvtm). Use something like dvtm -m ^w
- wide character support (librotew)
- *BSD compile fixes
- dvtm-0.01 released (08.12.2007).
Development
You can always fetch the current codebase from the git repository.
git clone git://repo.or.cz/dvtm.gitIf you have comments, suggestions, ideas, a bug report, a patch or something else related to dvtm then write to the dwm maling list (for now) or contact me directly mat[at]brain-dump.org.
Installation
In order to use dvtm you will need a curses library, for example libncurses.
Download the latest version of dvtm and extract it.
Edit config.mk to match your local setup (dvtm is installed into the /usr/local namespace by default).
Customize config.h as you see fit, see the configuration section
for further information.
If you are on a system with utf8 locales (if unsure check $LANG and the output of locale) you probably want
dvtm to be linked against libncursesw so type make unicode otherwise plain make should suffice.
$EDITOR config.mk
$EDITOR config.h
make
# or on a utf8 aware system
# make unicode
make installYou should now be able to start dvtm, redirect stderr to a file or /dev/null (just in case something goes wrong you will see it there).
./dvtm 2> logConfiguration
The configuration of dvtm is done by creating a custom config.h
and (re)compiling the source code. See the default config.h as an example adapting it to your
preference should be straightforward. You basically define a set of layouts and keys which dvtm
will use. There are some pre defined macros to ease configuration.
CTRL(char key)ALT(char key)CTRL_ALT(char key)COLOR(fg,bg)
Command line options
dvtm only contains 3 simple command line options.
-vprints the version and exits-m modsets the modifier during runtime and thus overrides settings in config.h. So-m ^wwill set the modifier to CTRL+w. This might be useful if you want to run multiple nested dvtm instances.-s status-fifoif status-fifo is a valid named pipe dvtm will read it's content and display it in the statusbar. See the dvtm-status script below which is also included in the source tarball for a possible usecase.
#!/bin/sh
FIFO="/tmp/dvtm-status.$$"
[ -e "$FIFO" ] || mkfifo "$FIFO"
chmod 600 $FIFO
while true; do
date +%H:%M
sleep 60
done > $FIFO &
STATUS_PID=$!
./dvtm -s $FIFO 2> /dev/null
kill $STATUS_PID
rm $FIFOTips and Tricks
If you just want to be able to detach and later reattach dvtm sessions i would suggest to use dtach.
dtach -c /tmp/dvtm-session -r winch dvtmIf you additionaly want something similiar to workspaces try running multiple dvtm sessions in different screen windows.
Layouts
dvtm currently includes 4 standard layouts, below is a schema of each one. These layouts are mostly adapted from dwm (the grid layout is enhanced to always use the whole screen). Porting a layout from dwm should be relatively easy.
+----------+----------+ +----------+----------+
| | | | | |
| | | | | |
| | | | | |
| | | | +----------+
| | | | | |
| | | | | |
| | | | | |
+---------------------+ +---------------------+
2 windows 3 windows
+----------+----------+ +----------+----------+
| | | | | |
| | | | +----------+
| +----------+ | | |
| | | | +----------+
| +----------+ | | |
| | | | +----------+
| | | | | |
+---------------------+ +---------------------+
4 windows 5 windows
+----------+----------+ +----------+----------+
| | | |
| | | |
| | | |
+---------------------+ +---------------------+
| | | | |
| | | | |
| | | | |
+---------------------+ +---------------------+
2 windows 3 windows
+---------------------+ +---------------------+
| | | |
| | | |
| | | |
+------+-------+------+ +----+-----+-----+----+
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
+------+-------+------+ +----+-----+-----+----+
4 windows 5 windows
+----------+----------+ +----------+----------+
| | | | | |
| | | | | |
| | | | | |
| | | +----------+----------+
| | | | |
| | | | |
| | | | |
+---------------------+ +---------------------+
2 windows 3 windows
+----------+----------+ +------+-------+------+
| | | | | | |
| | | | | | |
| | | | | | |
+----------+----------+ +------+---+---+------+
| | | | | |
| | | | | |
| | | | | |
+---------------------+ +---------------------+
4 windows 5 windows
The fullscreen layout displays only the currently selected window.
Screenshots
Below are a few screenshots which show dvtm in action.
- dvtm screenshot running elinks, irssi, mutt and cmus in tile layout
- dvtm screenshot running vim, top, elinks and cmus in bottom stack layout
- dvtm screenshot running mutt, irssi, elinks and cmus in grid layout
Links
Below are some links which are in one way or another related to dvtm.
License
dvtm reuses some code of dwm and is released under the same MIT/X11 license. madtty which is used for the terminal emulation is licensed under the GNU LGPL.
