- re-order and mostly re-write cwmrc(5)

- merge example config file into cwmrc(5) and remove (little good in here)

feedback from jmc@ - thanks!

ok simon@
This commit is contained in:
okan 2008-05-18 19:33:36 +00:00
parent 9a58e74401
commit 0f50af616e
2 changed files with 129 additions and 146 deletions

27
cwmrc
View File

@ -1,27 +0,0 @@
# $OpenBSD$
# Makes the Xft(3) font string fontname the default font
#fontname "sans-serif:pixelsize=14:bold"
# Set sticky group mode on
#sticky no
# Any entry here is shown in the application menu
#command firefox firefox
#command xmms xmms
#command top "xterm -e top"
# Autogroup definition
#autogroup 3 "aterm,XTerm"
#autogroup 3 "xterm,XTerm"
# Cause cwm to ignore programs by that name by not drawing borders around them.
#ignore XMMS
#ignore xwi
#ignore xapm
#ignore xclock
# Keys
#bind CM-r "label"
#bind CS-Return "xterm -e top"
#bind 4-o "unmap"

248
cwmrc.5
View File

@ -15,153 +15,163 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.\" The following requests are required for all man pages. .\" The following requests are required for all man pages.
.Dd $Mdocdate: April 15 2008 $ .Dd $Mdocdate: April 28 2008 $
.Dt CWMRC 5 .Dt CWMRC 5
.Os .Os
.Sh NAME .Sh NAME
.Nm cwmrc .Nm cwmrc
.Nd calm window manager configuration file .Nd calm window manager configuration file
.Sh DESCRIPTION .Sh DESCRIPTION
The This manual page describes the
.Xr cwm 1 .Xr cwm 1
window manager configuration file format. configuration file.
.Sh OPTIONS
There are quite a few settings that affect the operation of
.Xr cwm 1 .
.Pp
The following options are accepted in the configuration file: The following options are accepted in the configuration file:
.Pp .Pp
.Bl -tag -width Ds .Bl -tag -width Ds -compact
.It Ic fontname Ar font .It Ic autogroup Ar group Dq windowclass
Makes the .It Ic autogroup Ar group Dq windowclass,windowname
.Xr Xft 3 Control automatic window grouping, based on the class and/or name
font string properties, where
.Ar font .Ar group
the default font. is a number between 1 and 9.
.It Ic sticky Ic yes Ns \&| Ns Ic no .Pp
Set sticky group mode on. The class and name of a window may be obtained using
The default behavior for new windows is to not assign any group. .Xr xprop 1 .
This changes the default behavior to assigning the currrently selected .Pp
group to any newly created windows. .It Ic bind Ar keys Ar command
Cause the creation of a keybinding, or replacement of a default
keybinding.
The modifier keys come first, followed by a
.Sq - .
.Pp
The following modifiers are recognised:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It C
The Control key.
.It M
The Meta key.
.It S
The Shift key.
.It 2
The Mod2 key.
.It 3
The Mod3 key.
.It 4
The Mod4 key (normally the windows key).
.El
.Pp
The
.Sq -
should be followed by either a keysym name, taken from
.Pa /usr/X11R6/include/X11/keysymdef.h ,
or a numerical keycode value enclosed in
.Dq [] .
The
.Ar command
may either be the name of a task from the
.Dq name_to_kbfunc
structure in
.Pa conf.c ,
or the commandline that is to be executed.
.Pp
A special
.Ar command
keyword
.Dq unmap
can be used to remove the named keybinding.
This can be used to remove a binding which conflicts with an
application.
.Pp
.It Ic command Ar name Ar path .It Ic command Ar name Ar path
Every command entry is shown in the application menu. Every
When it is selected, the image is executed with .Ar name
entry is shown in the application menu.
When selected, the defined
.Ar path
is executed with
.Xr execve 2 . .Xr execve 2 .
.Pp .Pp
The entries The
.Ar name
entries
.Nm term .Nm term
and and
.Nm lock .Nm lock
have a special meaning. have a special meaning.
When they exist they point to the terminal program and screen locking They point to the terminal and screen locking programs specified by
programs used by the keybindings specified above. keybindings.
The defaults for these are The defaults are
.Xr xterm 1 .Xr xterm 1
and and
.Xr xlock 1 , .Xr xlock 1 ,
respectively. respectively.
.It Ic autogroup Ar group Dq windowclass
.It Ic autogroup Ar group Dq windowclass,windowname
Autogroups are read upon startup and control the
automatic grouping feature, which is based on the window name and class
properties.
The group is a number between 1 and 9.
.Pp .Pp
To obtain the name and class of a window, use .It Ic fontname Ar font
.Ql xprop WM_CLASS , Change the default
then click on the window. .Ar font
The first quoted string is the window name; the second one is the for
window class. .Xr Xft 3 .
.Pp .Pp
For example, to make all windows in the
.Xr xterm 1
class go to the third group:
.Bd -literal -offset indent
autogroup 3 XTerm
.Ed
.It Ic ignore Ar program
Ignore programs by that name by not drawing borders around them.
For example the command
.Bd -literal -offset indent
ignore xclock
.Ed
will cause any instances of
.Xr xclock 1
to not have borders.
.It Ic bind Ar keys Ar command
Cause the creation of keyboard shortcuts.
The default shortcuts will always be created.
In case of conflict, user-defined shortcuts take precidence.
The modifier keys come first, followed by a ``-''.
The following modifiers are recognised:
.Bl -tag -width Ds
.It Pa C
The Control key.
.It Pa M
The Meta key.
.It Pa S
The Shift key.
.It Pa 2
The Mod2 key.
.It Pa 3
The Mod3 key.
.It Pa 4
The Mod4 key (normally the windows key).
.El
The ``-'' should be followed by either a keysym name, taken from
.Pa /usr/X11R6/include/X11/keysymdef.h ,
or a numerical keycode value enclosed in ``[]''.
The command should be either the name of a task from the
``name_to_kbfunc''
structure in
.Pa conf.c ,
or, alternatively it should be the commandline that is wished to be executed.
A special case is the ``unmap'' keyword, which causes any bindings using the
named shortcut to be removed.
This can be used to remove a binding which conflicts with an application.
.Pp
For example, to cause
.Ic C-M-r
to add a label to a window:
.Bd -literal -offset indent
bind CM-r "label"
.Ed
.Pp
Launch an xterm running
.Xr top 1
with C-S-Enter:
.Bd -literal -offset indent
bind CS-Return "/usr/X11R6/bin/xterm -e top"
.Ed
.Pp
Remove a keybinding for Mod4-o
.Bd -literal -offset indent
bind 4-o "unmap"
.Ed
.It Ic gap Ar top bottom left right .It Ic gap Ar top bottom left right
Define "gaps" at the edge of the screen, so that when a window is maximized it will not overlap this area. Define a
This gap can be used for other applications such as .Dq gap
in pixels at the edge of the screen, so that when a
window is maximized it will not overlap this area.
This
.Dq gap
can be used for applications such as
.Xr xclock 1 , .Xr xclock 1 ,
which the user may wish to remain visible. where the user may wish to remain visible.
.Pp .Pp
.Pa top bottom left .It Ic ignore Ar windowname
and Ignore drawing borders around a window with the name
.Pa right .Ar windowname .
are the sizes of each the gap in pixels. .Pp
.It Ic sticky Ic yes Ns \&| Ns Ic no
Toggle sticky group mode.
The default behavior for new windows is to not assign any group.
By enabling sticky group mode,
.Xr cwm 1
will assign new windows to the currently selected group.
.El
.Sh EXAMPLE CONFIGURATION
.Bd -literal
# Set default Xft(3) font
fontname "sans-serif:pixelsize=14:bold"
# Set sticky group mode on
sticky no
# Any entry here is shown in the application menu
command firefox firefox
command xmms xmms
command top "xterm -e top"
# Autogroup definitions
autogroup 3 "aterm,XTerm"
autogroup 3 "xterm,XTerm"
# Ignore programs by that name by not drawing borders around them.
ignore XMMS
ignore xwi
ignore xapm
ignore xclock
# Keybindings
bind CM-r "label"
bind CS-Return "xterm -e top"
bind 4-o "unmap"
.Ed
.Sh FILES
.Bl -tag -width "~/.cwmrcXXX" -compact
.It Pa ~/.cwmrc
default
.Xr cwm 1
configuration file
.El .El
.Sh SEE ALSO .Sh SEE ALSO
.Xr cwm 1 .Xr cwm 1
.Sh AUTHORS
.An -nosplit
.Pp
.Nm
was initially written by
.An Marius Aamodt Eriksen Aq marius@monkey.org
with contributions from
.An Andy Adamson Aq dros@monkey.org ,
.An Niels Provos Aq provos@monkey.org ,
and
.An Antti Nykänen Aq aon@iki.fi .
.Sh HISTORY .Sh HISTORY
The The
.Nm .Nm