[manual index][section index]

NAME

qwm - window manager

SYNOPSIS

wm/qwm [ -d ] [ profile ]

DESCRIPTION

Qwm is a window manager. Its arrangement of stacks of windows in columns is similar to that of acme.

Qwm always has nine columns, 1-9. Visibility of each column can be toggled. Columns can be used as ``work spaces''. At least one column is always visible, by default columns 1 and 2. Focus is always at a column, and if that column has windows, on a window. The focus follows the mouse. A column can be in stack or single mode. In single mode, only one window is visible at the time, taking up the full height of the column. In stack mode, multiple windows can be visible at a time.

Columns can be moved and resized by clicking or dragging the box in their upper left corner. Windows can be moved and resized by dragging their title bar or clicking their buttons. Windows and columns can also be manipulated by keyboard commands. These commands are single characters preceded by a ^q, control-q. Keys exist for creating new windows, moving windows between columns, resizing windows, and resizing columns and making columns visible or hidden.

New windows are placed in the column with focus. If an adjacent column is at least 1.5 wider than the focused column, the window is placed there instead. In single mode, the new window is made visible and receives focus. In stacked mode, the new window takes the place of the largest window, leaving only the titlebar of the previously largest window visible. If the old window had focus (i.e. was in the focused column), it is ignored when looking for the largest window to replace. This is useful e.g. when the focused window has a list of files that can be opened by plumbing.

Options
If profile is given on the command line, it is executed by the shell after qwm is started. It is typically used to set up the namespace and start commands.

-d
Enable debug prints.

In the text below, B1, B2 and B3 stand for buttons 1, 2 and 3.

TAGS

Each column has a tag bar at the top. The tag bar contains, from left to right:

The column with focus has a brighter background for the column number and mode. For each column, the window number that has or would have focus (if its column had focus) also has a brighter background.

When editing text, the following keys are handled specially:

^h
Delete character before cursor.

^w
Delete word before cursor.

^u
Delete all text before cursor.

^a
Move cursor to start of text.

^e
Move cursor to end of text.

Left
Move cursor one character to the left.

Right
Move cursor one character to the right.

MOUSE

Mouse control in qwm is similar to that of acme. Mouse operations per area in the column:

Box
B1
Enlarge the column, preferrably taking space from columns on its right.
B2
Make the column as large as possible but leaving some minimal space for each column.
B3
Make the column the only one visible.
B1 drag
Move the column if B1 is released beyond another column's left side. Otherwise set the left side of the column to the position of B1's release.

Mode
B1
Switch the mode of the column, between stack and single.

Window sequence number
Clicking a window number with any of B1, B2 or B3 gives the focus to that window, also making sure it is visible. Further clicks are treated the same as clicks on the window's title bars. Dragging has no effect.

Commands
B1 sets the cursor for editing and resets the selection. Moving with B1 held expands the selection. Double clicking B1 selects the word under the pointer. Pressing B2 and moving with B2 held sets a new selection as well. Releasing B2 executes the selection if it is not empty, and otherwise the word under the pointer. Chording is not supported. Several commands are handled internally:

Hide
Hide the column.
Cols
Show all columns with one or more windows.
Showcol col
Make column col visible.
Killwin win
Kill processes servicing the program identified by window number win and drop all references to it, most importantly its window.
Program program
Set the program to run for ^qc to program.

Window title bar
A typical application has buttons for resizing, hiding/minimizing and closing the application. The resize button has no effect in qwm. Minimizing a window shows the next window when in single mode, and changes the size of the window so that only the title bar is still visible when in stack mode. Further operations:

B1
Makes the window larger if space can be taken from other applications while keeping at least their title bar visible.
B2
Like B1, but take as much space as possible.
B3
Use all space, leaving zero height for other applications. This is different from single mode, e.g. B1 and B2 still do as advertised above.
B1 drag
If the button is released over another column, moves the window to that column. If the button is released beyond another window's title bar, moves the window. Otherwise, resize the window. The window's title bar is left at the vertical position where the button was released.

KEYS

Key commands start with the modifier ^q, control-q (hence the name qwm). All commands are one character long. These characters can also be typed with control held, e.g. ``^q^c'' is equivalent to ``^qc''. This makes it easier to execute (multiple) commands. Some commands move the focus or change the size of windows. Qwm always makes sure the mouse is over the window or column that holds the focus. This makes it convenient to use both keyboard and mouse commands. In the commands below, ``window'' typically refers to the focused window, and ``column'' to the focused column.

c
Start new instance of wm/run.
x
Ask program to exit.
X
Kill processes servicing program and drop all references to it, most importantly its window.
q
Restore previous column configuration (which columns were visible), and restore focus to the window at that time.
j or k
Place focus on previous/next window in column.
J or K
Move window beyond previous/next window in column.
h or l
Place focus on previous/next column.
H or L
Move window to previous/next column.
1 to 9
Show only single column.
0
Show all columns with one or more windows.
shift-1 to shift-9
Toggle visibility of column.
f
Toggle mode for column, between stack and single.
F
Set single mode for the column, and hide all other columns.
i
Make window bigger.
u
Make window as big as possible without hiding other windows's title bars.
o
Make column bigger.
O
Make column as big as possible without hiding other columns.
r
Move mouse to position before last warp.
d
Toggle debug printing.
D
Print information about windows to stderr.

WMCTL

Reading from /chan/wmctl creates a new window, the tag of the window is returned. The following formats may be written to such file descriptors:

!reshape tag reqid minx miny maxx maxy [how]
!move tag reqid startx starty
!size tag reqid startx starty
start [ptr|kbd|control]
key decimal-key
delete tag
fixedorigin
kbdfocus [want]
lower and task
raise and unhide
ptr x y
cursor hotx hoty dx dy hex-image
max
full

The following writes to /chan/wmctl are allowed only for file descriptors with no tag associated:


program program
Set the program to run for ^qc.
cols
Show only columns with one or more windows.
showcol colnr
Make column colnr visible.
what color
With what one of: tagfg, tagbg, tagselbg, tagbox, colbg. Color must be a color in hexadecimal rrggbbaa format. These commands set the colors of the tags, column box and column background.

Qwm's screen size can be read from /chan/wmrect.

EXAMPLES

With the following in the profile, the program to run for ^qc is set to wm/sh and colors made similar to acme's (though without any borders!):

        echo -n 'program wm/sh' >/chan/wmctl &
        echo -n 'tagfg 000000ff' >/chan/wmctl &
        echo -n 'tagbg d4ffffff' >/chan/wmctl &
        echo -n 'tagselbg aaffffff' >/chan/wmctl &
        echo -n 'boxc 8888ccff' >/chan/wmctl &
        echo -n 'colbg ffffd4ff' >/chan/wmctl &

FILES

/chan/wmrect
/chan/wmctl

SOURCE

/appl/wm/qwm.b

SEE ALSO

wm(1), wm-run(1), acme(1)

BUGS

A "floating" layout mode, where windows can move freely, is not implemented.

Qwm cannot hide the title bar of windows, or influence the buttons displayed. The programs draw those themselves.

Inferno's default title bar does not act on B2 and B3 clicks on the title bar.

Qwm cannot currently run in an existing draw context.

Qwm does not work with wm/keyboard since focus (including keyboard focus) follows the mouse.

QWM(1 ) Rev:  Wed Feb 22 04:14:06 GMT 2023