]> code.delx.au - spectrwm/blob - spectrwm.1
Improve English man page.
[spectrwm] / spectrwm.1
1 .\" Copyright (c) 2009-2012 Marco Peereboom <marco@peereboom.us>
2 .\" Copyright (c) 2009 Darrin Chandler <dwchandler@stilyagin.com>
3 .\" Copyright (c) 2011-2014 Reginald Kennedy <rk@rejii.com>
4 .\" Copyright (c) 2011-2012 Lawrence Teo <lteo@lteo.net>
5 .\" Copyright (c) 2011-2012 Tiago Cunha <tcunha@gmx.com>
6 .\" Copyright (c) 2012 David Hill <dhill@mindcry.org>
7 .\"
8 .\" Permission to use, copy, modify, and distribute this software for any
9 .\" purpose with or without fee is hereby granted, provided that the above
10 .\" copyright notice and this permission notice appear in all copies.
11 .\"
12 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .\"
20 .Dd $Mdocdate: February 15 2012 $
21 .Dt SPECTRWM 1
22 .Os
23 .Sh NAME
24 .Nm spectrwm
25 .Nd window manager for X11
26 .Sh SYNOPSIS
27 .Nm spectrwm
28 .Sh DESCRIPTION
29 .Nm
30 is a minimalistic window manager that tries to stay out of the way so that
31 valuable screen real estate can be used for much more important stuff.
32 It has sane defaults and does not require one to learn a language to do any
33 configuration.
34 It was written by hackers for hackers and it strives to be small, compact and
35 fast.
36 .Pp
37 When
38 .Nm
39 starts up, it reads settings from its configuration file,
40 .Pa spectrwm.conf .
41 See the
42 .Sx CONFIGURATION FILES
43 section below.
44 .Pp
45 The following notation is used throughout this page:
46 .Pp
47 .Bl -tag -width Ds -offset indent -compact
48 .It Cm M
49 Meta
50 .It Cm S
51 Shift
52 .It Aq Cm Name
53 Named key
54 .It Cm M1
55 Mouse button 1
56 .It Cm M3
57 Mouse button 3
58 .El
59 .Pp
60 .Nm
61 is very simple in its use.
62 Most of the actions are initiated via key or mouse bindings.
63 See the
64 .Sx BINDINGS
65 section below for defaults and customizations.
66 .Sh CONFIGURATION FILES
67 .Nm
68 first tries to open the user specific file,
69 .Pa ~/.spectrwm.conf .
70 If that file is unavailable,
71 it then tries to open the global configuration file
72 .Pa /etc/spectrwm.conf .
73 .Pp
74 The format of the file is
75 .Pp
76 .Dl Ar keyword Li = Ar setting
77 .Pp
78 For example:
79 .Pp
80 .Dl color_focus = red
81 .Pp
82 Enabling or disabling an option is done by using 1 or 0 respectively.
83 .Pp
84 Colors need to be specified per the
85 .Xr XQueryColor 3
86 specification.
87 .Pp
88 Comments begin with a #. When a literal
89 .Ql #
90 is desired in an option, then it
91 must be escaped with a backslash. i.e. \e#
92 .Pp
93 The file supports the following keywords:
94 .Bl -tag -width 2m
95 .It Ic autorun
96 Launch an application in a specified workspace at start-of-day.
97 Defined in the format
98 .Li ws Ns Bo Ar idx Bc : Ns Ar application ,
99 e.g. ws[2]:xterm launches an
100 xterm in workspace 2.
101 .It Ic bar_action
102 External script that populates additional information in the status bar,
103 such as battery life.
104 .It Ic bar_at_bottom
105 Place the statusbar at the bottom of each region instead of the top.
106 .It Ic bar_border Ns Bq Ar x
107 Border color of the status bar(s) in screen
108 .Ar x .
109 .It Ic bar_border_unfocus Ns Bq Ar x
110 Border color of the status bar(s) on unfocused region(s) in screen
111 .Ar x .
112 .It Ic bar_border_width
113 Set status bar border thickness in pixels.
114 Disable border by setting to 0.
115 .It Ic bar_color Ns Bq Ar x
116 Background color of the status bar(s) in screen
117 .Ar x .
118 .It Ic bar_enabled
119 Set default
120 .Ic bar_toggle
121 state; default is 1.
122 .It Ic bar_enabled_ws Ns Bq Ar x
123 Set default
124 .Ic bar_toggle_ws
125 state on workspace
126 .Ar x ;
127 default is 1.
128 .It Ic bar_font
129 Font used in the status bar. Either Xft or X Logical Font Description (XLFD)
130 may be used to specify fonts. Fallback fonts may be specified by separating
131 each font with a comma. If all entries are in XLFD syntax, font set will be
132 used. If at least one entry is Xft, Xft will be used. Note that if Xft is in
133 use, only the first font that successfully loads will be used regardless of
134 missing glyphs. The default is to use font set. Also note that
135 .Xr dmenu 1
136 does not support Xft fonts.
137 .Pp
138 Xft examples:
139 .Bd -literal -offset indent
140 bar_font = Terminus:style=Regular:pixelsize=14:antialias=true
141
142 bar_font = -*-profont-medium-*-*-*-11-*-*-*-*-*-*-*,Terminus:pixelsize=14,\
143 -*-clean-medium-*-*-*-12-*-*-*-*-*-*-*
144 .Ed
145 .Pp
146 Font set examples:
147 .Bd -literal -offset indent
148 bar_font = -*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*
149
150 bar_font = -*-profont-medium-*-*-*-11-*-*-*-*-*-*-*,\
151 -*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*,\
152 -*-clean-medium-*-*-*-12-*-*-*-*-*-*-*
153 .Ed
154 .Pp
155 To list the available fonts in your system see
156 .Xr fc-list 1
157 or
158 .Xr xlsfonts 1
159 manpages.
160 The
161 .Xr xfontsel 1
162 application can help with the XLFD setting.
163 .It Ic bar_font_color Ns Bq Ar x
164 Color of the font in status bar in screen
165 .Ar x .
166 .It Ic bar_format
167 Set the bar format string, overriding
168 .Ic clock_format
169 and all of the
170 .Ic enabled
171 options.
172 The format is passed through
173 .Xr strftime 3
174 before being used.
175 It may contain the following character sequences:
176 .Bl -column "Character sequence" "Replaced with" -offset indent
177 .It Sy "Character sequence" Ta Sy "Replaced with"
178 .It Li "+<" Ta "Pad with a space"
179 .It Li "+A" Ta "Output of the external script"
180 .It Li "+C" Ta "Window class (from WM_CLASS)"
181 .It Li "+D" Ta "Workspace name"
182 .It Li "+F" Ta "Floating indicator"
183 .It Li "+I" Ta "Workspace index"
184 .It Li "+M" Ta "Number of iconic (minimized) windows in workspace"
185 .It Li "+N" Ta "Screen number"
186 .It Li "+P" Ta "Window class and instance separated by a colon"
187 .It Li "+S" Ta "Stacking algorithm"
188 .It Li "+T" Ta "Window instance (from WM_CLASS)"
189 .It Li "+U" Ta "Urgency hint"
190 .It Li "+V" Ta "Program version"
191 .It Li "+W" Ta "Window name (from _NET_WM_NAME/WM_NAME)"
192 .It Li "++" Ta "A literal" Ql +
193 .El
194 .Pp
195 All character sequences may limit its output to a specific length, for
196 example +64A. Any characters that don't match the specification are copied
197 as-is.
198 .It Ic bar_justify
199 Justify the status bar text. Possible values are
200 .Ar left ,
201 .Ar center ,
202 and
203 .Ar right .
204 .Pp
205 Note that if the output is not left justified, it may not be properly
206 aligned in some circumstances, due to the white-spaces in the default
207 static format.
208 See the
209 .Ic bar_format
210 option for more details.
211 .It Ic bind Ns Bq Ar x
212 Bind key combo to action
213 .Ar x .
214 See the
215 .Sx BINDINGS
216 section below.
217 .It Ic border_width
218 Set window border thickness in pixels.
219 Disable all borders by setting to 0.
220 .It Ic boundary_width
221 Set region containment boundary width in pixels. This is how far a window
222 must be dragged/resized beyond the region edge before it is allowed outside
223 the region. This has no effect when manipulating the window with key
224 bindings. Disable the window containment effect by setting to 0.
225 .It Ic clock_enabled
226 Enable or disable displaying the clock in the status bar.
227 Disable by setting to 0
228 so a custom clock could be used in the
229 .Ic bar_action
230 script.
231 .It Ic iconic_enabled
232 Display the number of iconic (minimized) windows in the status bar.
233 Enable by setting to 1.
234 .It Ic color_focus
235 Border color of the currently focused window. Default is red.
236 .It Ic color_focus_maximized
237 Border color of the currently focused, maximized window. Defaults to the
238 value of
239 .Ic color_focus .
240 .It Ic color_unfocus
241 Border color of unfocused windows, default is rgb:88/88/88.
242 .It Ic color_unfocus_maximized
243 Border color of unfocused, maximized windows. Defaults to the value of
244 .Ic color_unfocus .
245 .It Ic dialog_ratio
246 Some applications have dialogue windows that are too small to be useful.
247 This ratio is the screen size to what they will be resized.
248 For example, 0.6 is 60% of the physical screen size.
249 .It Ic disable_border
250 Remove border when bar is disabled and there is only one window on the
251 region.
252 .It Ic focus_close
253 Window to put focus when the focused window is closed.
254 Possible values are
255 .Ar first ,
256 .Ar next ,
257 .Ar previous
258 (default) and
259 .Ar last .
260 .Ar next
261 and
262 .Ar previous
263 are relative to the window that is closed.
264 .It Ic focus_close_wrap
265 Whether to allow the focus to jump to the last window when the first window
266 is closed or vice versa. Disable by setting to 0.
267 .It Ic focus_default
268 Window to put focus when no window has been focused. Possible values are
269 .Ar first
270 and
271 .Ar last
272 (default).
273 .It Ic focus_mode
274 Window focus behavior with respect to the mouse cursor. Possible values:
275 .Pp
276 .Bl -tag -width "default" -offset indent -compact
277 .It Ar default
278 Set window focus on border crossings caused by cursor motion and
279 window interaction.
280 .It Ar follow
281 Set window focus on all cursor border crossings, including workspace switches
282 and changes to layout.
283 .It Ar manual
284 Set window focus on window interaction only.
285 .El
286 .It Ic java_workaround
287 Workaround a Java GUI rendering issue on non-reparenting window managers by
288 impersonating the LG3D window manager, written by Sun. Default is 1.
289 .It Ic keyboard_mapping
290 Clear all key bindings and load new key bindings from the specified file.
291 This allows you to load pre-defined key bindings for your keyboard layout.
292 See the
293 .Sx KEYBOARD MAPPING FILES
294 section below for a list of keyboard mapping files that have been provided
295 for several keyboard layouts.
296 .It Ic layout
297 Select layout to use at start-of-day. Defined in the format
298 .Li ws Ns Bo Ar idx Bc : Ns Ar master_grow : Ns Ar master_add : Ns Ar stack_inc : Ns Ar always_raise : Ns Ar stack_mode ,
299 e.g. ws[2]:-4:0:1:0:horizontal sets worskspace 2 to the horizontal stack
300 mode, shrinks the master area by 4 ticks and adds one window to the
301 stack, while maintaining default floating window behavior.
302 Possible
303 .Ar stack_mode
304 values are
305 .Ar vertical ,
306 .Ar vertical_flip ,
307 .Ar horizontal ,
308 .Ar horizontal_flip
309 and
310 .Ar fullscreen .
311 .Pp
312 See
313 .Ic master_grow ,
314 .Ic master_shrink ,
315 .Ic master_add ,
316 .Ic master_del ,
317 .Ic stack_inc ,
318 .Ic stack_dec ,
319 and
320 .Ic always_raise
321 for more information.
322 Note that the stacking options are complicated and have side-effects. One
323 should familiarize oneself with these commands before experimenting with the
324 .Ic layout
325 option.
326 .Pp
327 This setting is not retained at restart.
328 .It Ic modkey
329 Change mod key.
330 Mod1 is generally the ALT key and Mod4 is the windows key on a PC.
331 .It Ic name
332 Set the name of a workspace at start-of-day.
333 Defined in the format
334 .Li ws Ns Bo Ar idx Bc : Ns Ar name ,
335 e.g. ws[1]:Console sets the name of workspace 1 to
336 .Dq Console .
337 .It Ic program Ns Bq Ar p
338 Define new action to spawn a program
339 .Ar p .
340 See the
341 .Sx PROGRAMS
342 section below.
343 .It Ic quirk Ns Bq Ar c Ns Li : Ns Ar i Ns Li : Ns Ar n
344 Add "quirk" for windows with class
345 .Ar c ,
346 instance
347 .Ar i
348 and name
349 .Ar n .
350 See the
351 .Sx QUIRKS
352 section below.
353 .It Ic region
354 Allocates a custom region, removing any autodetected regions which occupy the
355 same space on the screen.
356 Defined in the format
357 .Li screen Ns Bo Ar idx Ns Bc : Ns Ar width Ns x Ns Ar height Ns + Ns Ar x Ns + Ns Ar y ,
358 e.g. screen[1]:800x1200+0+0.
359 .Pp
360 To make a region span multiple monitors, create a region big enough to cover
361 them all, e.g. screen[1]:2048x768+0+0 makes the region span two monitors with
362 1024x768 resolution sitting one next to the other.
363 .It Ic region_padding
364 Pixel width of empty space within region borders.
365 Disable by setting to 0.
366 .It Ic spawn_position
367 Position in stack to place newly spawned windows.
368 Possible values are
369 .Ar first ,
370 .Ar next ,
371 .Ar previous
372 and
373 .Ar last
374 (default).
375 .Ar next
376 and
377 .Ar previous
378 are relative to the focused window.
379 .It Ic stack_enabled
380 Enable or disable displaying the current stacking algorithm in the status
381 bar.
382 .It Ic term_width
383 Set a preferred minimum width for the terminal.
384 If this value is greater than 0,
385 .Nm
386 will attempt to adjust the font sizes in the terminal to keep the terminal
387 width above this number as the window is resized.
388 Only
389 .Xr xterm 1
390 is currently supported.
391 The
392 .Xr xterm 1
393 binary must not be setuid or setgid, which it is by default on most systems.
394 Users may need to set program[term] (see the
395 .Sx PROGRAMS
396 section) to use an alternate copy of the
397 .Xr xterm 1
398 binary without the setgid bit set.
399 .It Ic tile_gap
400 Pixel width of empty space between tiled windows. Negative values cause overlap.
401 Set this to the opposite of border_width to collapse the border between tiles.
402 Disable by setting to 0.
403 .It Ic urgent_enabled
404 Enable or disable the urgency hint indicator in the status bar.
405 Note that many terminal emulators require an explicit setting for the bell
406 character to trigger urgency on the window. In
407 .Xr xterm 1 ,
408 for example, one needs to add the following line to
409 .Pa .Xdefaults :
410 .Bd -literal -offset indent
411 xterm.bellIsUrgent: true
412 .Ed
413 .It Ic verbose_layout
414 Enable or disable displaying the current master window count and stack column/row
415 count in the status bar.
416 Enable by setting to 1.
417 See
418 .Ar master_add ,
419 .Ar master_del ,
420 .Ar stack_inc
421 and
422 .Ar stack_dec
423 for more information.
424 .It Ic window_class_enabled
425 Enable or disable displaying the window class name (from WM_CLASS) in the
426 status bar. Enable by setting to 1.
427 .It Ic window_instance_enabled
428 Enable or disable displaying the window instance name (from WM_CLASS) in the
429 status bar. Enable by setting to 1.
430 .It Ic window_name_enabled
431 Enable or disable displaying the window display name (from _NET_WM_NAME/WM_NAME)
432 in the status bar. Enable by setting to 1.
433 .Pp
434 To prevent excessively large window names from pushing the remaining text off
435 the bar, it's limited to 64 characters, by default.
436 See the
437 .Ic bar_format
438 option for more details.
439 .It Ic warp_pointer
440 Centers the mouse pointer on the focused window when using key bindings to
441 change focus, switch workspaces, change regions, etc. Enable by setting to 1.
442 .It Ic workspace_limit
443 Set the total number of workspaces available. Minimum is 1, maximum is 22,
444 default is 10.
445 .El
446 .Sh PROGRAMS
447 .Nm
448 allows you to define custom actions to launch programs of your choice and
449 then bind them the same as with built-in actions.
450 See the
451 .Sx BINDINGS
452 section below.
453 .Pp
454 Custom programs in the configuration file are specified as follows:
455 .Pp
456 .Dl program Ns Bo Ar action Bc = Ar progpath Op Ar arg Op Ar arg ...
457 .Pp
458 .Ar action
459 is any identifier that does not conflict with a built-in action or keyword,
460 .Ar progpath
461 is the desired program, and
462 .Ar arg
463 is zero or more arguments to the program.
464 .Pp
465 Remember that when using # in your program call, it must be escaped with a
466 backslash. i.e. \e#
467 .Pp
468 The following argument variables will be substituted for values at the time the program
469 is spawned:
470 .Pp
471 .Bl -tag -width "$bar_font_color" -offset indent -compact
472 .It Cm $bar_border
473 .It Cm $bar_color
474 .It Cm $bar_font
475 .It Cm $bar_font_color
476 .It Cm $color_focus
477 .It Cm $color_unfocus
478 .It Cm $dmenu_bottom
479 \-b if bar_at_bottom is enabled.
480 .It Cm $region_index
481 .It Cm $workspace_index
482 .El
483 .Pp
484 Example:
485 .Bd -literal -offset indent
486 program[ff] = /usr/local/bin/firefox http://spectrwm.org/
487 bind[ff] = MOD+Shift+b # Now M-S-b launches firefox
488 .Ed
489 .Pp
490 To cancel the previous, unbind it:
491 .Bd -literal -offset indent
492 bind[] = MOD+Shift+b
493 .Ed
494 .Pp
495 Default programs:
496 .Bl -tag -width "screenshot_wind" -offset indent -compact
497 .It Cm lock
498 xlock
499 .It Cm menu
500 dmenu_run $dmenu_bottom \-fn $bar_font \-nb $bar_color \-nf $bar_font_color \-sb
501 $bar_border \-sf $bar_color
502 .It Cm term
503 xterm
504 .It Cm initscr
505 initscreen.sh # optional
506 .It Cm screenshot_all
507 screenshot.sh full # optional
508 .It Cm screenshot_wind
509 screenshot.sh window # optional
510 .El
511 .Pp
512 Note that optional default programs will not be validated unless overridden.
513 If a default program fails validation, you can resolve the exception
514 by installing the program, modifying the program call or disabling the program
515 by freeing the respective key binding.
516 .Pp
517 For example, to override
518 .Ic lock :
519 .Bd -literal -offset indent
520 program[lock] = xscreensaver\-command \-\-lock
521 .Ed
522 .Pp
523 To unbind
524 .Ic lock
525 and prevent it from being validated:
526 .Bd -literal -offset indent
527 bind[] = MOD+Shift+Delete
528 .Ed
529 .Sh BINDINGS
530 .Nm
531 provides many functions (or actions) accessed via key or mouse bindings.
532 .Pp
533 The current mouse bindings are described below:
534 .Pp
535 .Bl -tag -width "M-j, M-<TAB>XXX" -offset indent -compact
536 .It Cm M1
537 Focus window
538 .It Cm M-M1
539 Move window
540 .It Cm M-M3
541 Resize window
542 .It Cm M-S-M3
543 Resize window while maintaining it centered
544 .El
545 .Pp
546 The default key bindings are described below:
547 .Pp
548 .Bl -tag -width "M-j, M-<TAB>XXXXXX" -offset indent -compact
549 .It Cm M-S- Ns Aq Cm Return
550 term
551 .It Cm M-p
552 menu
553 .It Cm M-S-q
554 quit
555 .It Cm M-q
556 restart
557 .It Cm M- Ns Aq Cm Space
558 cycle_layout
559 .It Cm M-S-\e
560 flip_layout
561 .It Cm M-S- Ns Aq Cm Space
562 stack_reset
563 .It Cm M-h
564 master_shrink
565 .It Cm M-l
566 master_grow
567 .It Cm M-,
568 master_add
569 .It Cm M-.
570 master_del
571 .It Cm M-S-,
572 stack_inc
573 .It Cm M-S-.
574 stack_dec
575 .It Cm M- Ns Aq Cm Return
576 swap_main
577 .It Xo
578 .Cm M-j ,
579 .Cm M- Ns Aq Cm TAB
580 .Xc
581 focus_next
582 .It Xo
583 .Cm M-k ,
584 .Cm M-S- Ns Aq Cm TAB
585 .Xc
586 focus_prev
587 .It Cm M-m
588 focus_main
589 .It Cm M-u
590 focus_urgent
591 .It Cm M-S-j
592 swap_next
593 .It Cm M-S-k
594 swap_prev
595 .It Cm M-b
596 bar_toggle
597 .It Cm M-S-b
598 bar_toggle_ws
599 .It Cm M-x
600 wind_del
601 .It Cm M-S-x
602 wind_kill
603 .It Cm M- Ns Aq Ar 1-9,0,F1-F12
604 .Pf ws_ Aq Ar 1-22
605 .It Cm M-S- Ns Aq Ar 1-9,0,F1-F12
606 .Pf mvws_ Ns Aq Ar 1-22
607 .It Cm M- Ns Aq Ar Keypad 1-9
608 .Pf rg_ Aq Ar 1-9
609 .It Cm M-S- Ns Aq Ar Keypad 1-9
610 .Pf mvrg_ Aq Ar 1-9
611 .It Cm M- Ns Aq Cm Right
612 ws_next
613 .It Cm M- Ns Aq Cm Left
614 ws_prev
615 .It Cm M- Ns Aq Cm Up
616 ws_next_all
617 .It Cm M- Ns Aq Cm Down
618 ws_prev_all
619 .It Cm M-a
620 ws_next_move
621 .It Cm M-S- Ns Aq Cm Left
622 ws_prev_move
623 .It Cm M-S- Ns Aq Cm Up
624 ws_prior
625 .It Cm M-S- Ns Aq Cm Right
626 rg_next
627 .It Cm M-S- Ns Aq Cm Left
628 rg_prev
629 .It Cm M-s
630 screenshot_all
631 .It Cm M-S-s
632 screenshot_wind
633 .It Cm M-S-v
634 version
635 .It Cm M-t
636 float_toggle
637 .It Cm M-S- Ns Aq Cm Delete
638 lock
639 .It Cm M-S-i
640 initscr
641 .It Cm M-w
642 iconify
643 .It Cm M-S-w
644 uniconify
645 .It Cm M-e
646 maximize_toggle
647 .It Cm M-S-r
648 always_raise
649 .It Cm M-v
650 button2
651 .It Cm M--
652 width_shrink
653 .It Cm M-=
654 width_grow
655 .It Cm M-S--
656 height_shrink
657 .It Cm M-S-=
658 height_grow
659 .It Cm M-[
660 move_left
661 .It Cm M-]
662 move_right
663 .It Cm M-S-[
664 move_up
665 .It Cm M-S-]
666 move_down
667 .It Cm M-S-/
668 name_workspace
669 .It Cm M-/
670 search_workspace
671 .It Cm M-f
672 search_win
673 .El
674 .Pp
675 The action names and descriptions are listed below:
676 .Pp
677 .Bl -tag -width "M-j, M-<TAB>XXXX" -offset indent -compact
678 .It Cm term
679 Spawn a new terminal
680 (see
681 .Sx PROGRAMS
682 above).
683 .It Cm menu
684 Menu
685 (see
686 .Sx PROGRAMS
687 above).
688 .It Cm quit
689 Quit
690 .Nm .
691 .It Cm restart
692 Restart
693 .Nm .
694 .It Cm cycle_layout
695 Cycle layout.
696 .It Cm flip_layout
697 Swap the master and stacking areas.
698 .It Cm stack_reset
699 Reset layout.
700 .It Cm master_shrink
701 Shrink master area.
702 .It Cm master_grow
703 Grow master area.
704 .It Cm master_add
705 Add windows to master area.
706 .It Cm master_del
707 Remove windows from master area.
708 .It Cm stack_inc
709 Add columns/rows to stacking area.
710 .It Cm stack_dec
711 Remove columns/rows from stacking area.
712 .It Cm swap_main
713 Move current window to master area.
714 .It Cm focus_next
715 Focus next window in workspace.
716 .It Cm focus_prev
717 Focus previous window in workspace.
718 .It Cm focus_main
719 Focus on main window in workspace.
720 .It Cm focus_urgent
721 Focus on next window with the urgency hint flag set. The workspace is switched if needed.
722 .It Cm swap_next
723 Swap with next window in workspace.
724 .It Cm swap_prev
725 Swap with previous window in workspace.
726 .It Cm bar_toggle
727 Toggle overall visibility of status bars.
728 .It Cm bar_toggle_ws
729 Toggle status bar on current workspace.
730 .It Cm wind_del
731 Delete current window in workspace.
732 .It Cm wind_kill
733 Destroy current window in workspace.
734 .It Cm ws_ Ns Ar n
735 Switch to workspace
736 .Ar n ,
737 where
738 .Ar n
739 is 1 through
740 .Ic workspace_limit .
741 .It Cm mvws_ Ns Ar n
742 Move current window to workspace
743 .Ar n ,
744 where
745 .Ar n
746 is 1 through
747 .Ic workspace_limit .
748 .It Cm rg_ Ns Ar n
749 Focus on region
750 .Ar n ,
751 where
752 .Ar n
753 is 1 through 9.
754 .It Cm mvrg_ Ns Ar n
755 Move current window to region
756 .Ar n ,
757 where
758 .Ar n
759 is 1 through 9.
760 .It Cm ws_next
761 Switch to next workspace with a window in it.
762 .It Cm ws_prev
763 Switch to previous workspace with a window in it.
764 .It Cm ws_next_all
765 Switch to next workspace.
766 .It Cm ws_prev_all
767 Switch to previous workspace.
768 .It Cm ws_next_move
769 Switch to next workspace with the current window.
770 .It Cm ws_prev_move
771 Switch to previous workspace with the current window.
772 .It Cm ws_prior
773 Switch to last visited workspace.
774 .It Cm rg_next
775 Switch to next region.
776 .It Cm rg_prev
777 Switch to previous region.
778 .It Cm screenshot_all
779 Take screenshot of entire screen (if enabled)
780 (see
781 .Sx PROGRAMS
782 above).
783 .It Cm screenshot_wind
784 Take screenshot of selected window (if enabled)
785 (see
786 .Sx PROGRAMS
787 above).
788 .It Cm version
789 Toggle version in status bar.
790 .It Cm float_toggle
791 Toggle focused window between tiled and floating.
792 .It Cm lock
793 Lock screen
794 (see
795 .Sx PROGRAMS
796 above).
797 .It Cm initscr
798 Reinitialize physical screens
799 (see
800 .Sx PROGRAMS
801 above).
802 .It Cm iconify
803 Minimize (unmap) currently focused window.
804 .It Cm uniconify
805 Restore (map) window returned by
806 .Xr dmenu 1
807 selection.
808 .It Cm maximize_toggle
809 Toggle maximization of focused window.
810 .It Cm always_raise
811 When set tiled windows are allowed to obscure floating windows.
812 .It Cm button2
813 Fake a middle mouse button click (mouse button 2).
814 .It Cm width_shrink
815 Shrink the width of a floating window.
816 .It Cm width_grow
817 Grow the width of a floating window.
818 .It Cm height_shrink
819 Shrink the height of a floating window.
820 .It Cm height_grow
821 Grow the height of a floating window.
822 .It Cm move_left
823 Move a floating window a step to the left.
824 .It Cm move_right
825 Move a floating window a step to the right.
826 .It Cm move_up
827 Move a floating window a step upwards.
828 .It Cm move_down
829 Move a floating window a step downwards.
830 .It Cm name_workspace
831 Name the current workspace.
832 .It Cm search_workspace
833 Search for a workspace.
834 .It Cm search_win
835 Search the windows in the current workspace.
836 .El
837 .Pp
838 Custom bindings in the configuration file are specified as follows:
839 .Pp
840 .Dl bind Ns Bo Ar action Bc = Ar keys
841 .Pp
842 .Ar action
843 is one of the actions listed above (or empty to unbind) and
844 .Ar keys
845 is in the form of zero or more modifier keys
846 (MOD, Mod1, Shift, etc.) and one or more normal keys
847 (b, Space, etc.), separated by
848 .Ql + .
849 .Pp
850 Example:
851 .Bd -literal -offset indent
852 bind[reset] = Mod4+q # bind Windows-key + q to reset
853 bind[] = Mod1+q # unbind Alt + q
854 .Ed
855 .Pp
856 To use the currently defined
857 .Ic modkey ,
858 specify MOD as the modifier key.
859 .Pp
860 Multiple key combinations may be bound to the same action.
861 .Pp
862 To bind non-latin characters such as \[oa] or \[*p] you must enter the xkb
863 character name instead of the character itself. Run xev, focus the window
864 and press the specific key and in the terminal output read the symbol name.
865 In the following example for \[oa]:
866 .Bd -literal -offset indent
867 KeyPress event, serial 41, synthetic NO, window 0x2600001,
868 root 0x15a, subw 0x0, time 106213808, (11,5), root:(359,823),
869 state 0x0, keycode 24 (keysym 0xe5, aring), same_screen YES,
870 XLookupString gives 2 bytes: (c3 a5) "\[oa]"
871 XmbLookupString gives 2 bytes: (c3 a5) "\[oa]"
872 XFilterEvent returns: False
873 .Ed
874 .Pp
875 The xkb name is aring. In other words, in
876 .Pa spectrwm.conf
877 add:
878 .Bd -literal -offset indent
879 bind[program] = MOD+aring
880 .Ed
881 .Sh KEYBOARD MAPPING FILES
882 Keyboard mapping files for several keyboard layouts are listed
883 below.
884 These files can be used with the
885 .Ic keyboard_mapping
886 setting to load pre-defined key bindings for the specified
887 keyboard layout.
888 .Pp
889 .Bl -tag -width "spectrwm_XX.confXXX" -offset indent -compact
890 .It Cm spectrwm_cz.conf
891 Czech Republic keyboard layout
892 .It Cm spectrwm_es.conf
893 Spanish keyboard layout
894 .It Cm spectrwm_fr.conf
895 French keyboard layout
896 .It Cm spectrwm_fr_ch.conf
897 Swiss French keyboard layout
898 .It Cm spectrwm_se.conf
899 Swedish keyboard layout
900 .It Cm spectrwm_us.conf
901 United States keyboard layout
902 .El
903 .Sh QUIRKS
904 .Nm
905 provides "quirks" which handle windows that must be treated specially
906 in a tiling window manager, such as some dialogs and fullscreen apps.
907 .Pp
908 The default quirks are described below:
909 .Pp
910 .Bl -tag -width "OpenOffice.org N.M:VCLSalFrame<TAB>XXX" -offset indent \
911 -compact
912 .It Firefox\-bin:firefox\-bin
913 TRANSSZ
914 .It Firefox:Dialog
915 FLOAT
916 .It Gimp:gimp
917 FLOAT + ANYWHERE
918 .It MPlayer:xv
919 FLOAT + FULLSCREEN + FOCUSPREV
920 .It OpenOffice.org 2.4:VCLSalFrame
921 FLOAT
922 .It OpenOffice.org 3.1:VCLSalFrame
923 FLOAT
924 .It pcb:pcb
925 FLOAT
926 .It xine:Xine Window
927 FLOAT + ANYWHERE
928 .It xine:xine Panel
929 FLOAT + ANYWHERE
930 .It xine:xine Video Fullscreen Window
931 FULLSCREEN + FLOAT
932 .It Xitk:Xitk Combo
933 FLOAT + ANYWHERE
934 .It Xitk:Xine Window
935 FLOAT + ANYWHERE
936 .It XTerm:xterm
937 XTERM_FONTADJ
938 .El
939 .Pp
940 The quirks themselves are described below:
941 .Pp
942 .Bl -tag -width "XTERM_FONTADJ<TAB>XXX" -offset indent -compact
943 .It FLOAT
944 This window should not be tiled, but allowed to float freely.
945 .It TRANSSZ
946 Adjusts size on transient windows that are too small using
947 .Ic dialog_ratio
948 (see
949 .Sx CONFIGURATION FILES ) .
950 .It ANYWHERE
951 Allow window to position itself, uncentered.
952 .It XTERM_FONTADJ
953 Adjust xterm fonts when resizing.
954 .It FULLSCREEN
955 Remove border to allow window to use full region size.
956 .It FOCUSPREV
957 On exit force focus on previously focused application not previous
958 application in the stack.
959 .It NOFOCUSONMAP
960 Don't change focus to the window when it first appears on the screen.
961 Has no effect when
962 .Ic focus_mode
963 is set to
964 .Ar follow .
965 .It FOCUSONMAP_SINGLE
966 When the window first appears on the screen, change focus to the window
967 if there are no other windows on the workspace with the same WM_CLASS
968 class/instance value. Has no effect when
969 .Ic focus_mode
970 is set to
971 .Ar follow .
972 .It OBEYAPPFOCUSREQ
973 When an application requests focus on the window via a _NET_ACTIVE_WINDOW
974 client message (source indication of 1), comply with the request.
975 Note that a source indication of 0 (unspecified) or 2 (pager) are always
976 obeyed.
977 .It IGNOREPID
978 Ignore the PID when determining the initial workspace for a new window.
979 Especially useful for terminal windows that share a process.
980 .It IGNORESPAWNWS
981 Ignore the spawn workspace when determining the initial workspace for a
982 new window.
983 .El
984 .Pp
985 Custom quirks in the configuration file are specified as follows:
986 .Pp
987 .Dl quirk Ns Bo Ar class Ns Bo : Ns Ar instance Ns Bo : Ns Ar name Bc Bc Bc = Ar quirk Op + Ar quirk ...
988 .Pp
989 .Ar class ,
990 .Ar instance
991 (optional) and
992 .Ar name
993 (optional) are patterns used to determine which window(s) the quirk(s) apply
994 to and
995 .Ar quirk
996 is one of the quirks from the list above.
997 .Pp
998 Note that patterns are interpreted as POSIX Extended Regular Expressions.
999 Any ':', '[' or ']' must be escaped with '\\'.
1000 See
1001 .Xr regex 7
1002 for more information on POSIX Extended Regular Expressions.
1003 .Pp
1004 For example:
1005 .Bd -literal -offset indent
1006 quirk[MPlayer] = FLOAT + FULLSCREEN + FOCUSPREV # Float all windows having a \
1007 class of 'MPlayer'
1008 quirk[.*] = FLOAT # Float all windows by default.
1009 quirk[.*:.*:.*] = FLOAT # Same as above.
1010 quirk[Firefox:Navigator] = FLOAT # Float all Firefox browser windows.
1011 quirk[::Console] = FLOAT # Float windows with WM_CLASS not set and a \
1012 window name of 'Console'.
1013 quirk[\\[0-9\\].*:.*:\\[\\[\\:alnum\\:\\]\\]*] = FLOAT # Float windows with WM_CLASS \
1014 class beginning with a number, any WM_CLASS instance and a \
1015 _NET_WM_NAME/WM_NAME either blank or containing alphanumeric characters without spaces.
1016 quirk[pcb:pcb] = NONE # remove existing quirk
1017 .Ed
1018 .Pp
1019 You can obtain
1020 .Ar class ,
1021 .Ar instance
1022 and
1023 .Ar name
1024 by running
1025 .Xr xprop 1
1026 and then clicking on the desired window.
1027 In the following example the main window of Firefox was clicked:
1028 .Bd -literal -offset indent
1029 $ xprop | grep \-E "^(WM_CLASS|_NET_WM_NAME|WM_NAME)"
1030 WM_CLASS(STRING) = "Navigator", "Firefox"
1031 WM_NAME(STRING) = "spectrwm - ConformalOpenSource"
1032 _NET_WM_NAME(UTF8_STRING) = "spectrwm - ConformalOpenSource"
1033 .Ed
1034 .Pp
1035 Note that
1036 .Xr xprop 1
1037 displays WM_CLASS as:
1038 .Bd -literal -offset indent
1039 WM_CLASS(STRING) = "<instance>", "<class>"
1040 .Ed
1041 .Pp
1042 In the example above the quirk entry would be:
1043 .Bd -literal -offset indent
1044 quirk[Firefox:Navigator] = FLOAT
1045 .Ed
1046 .Pp
1047 .Nm
1048 also automatically assigns quirks to windows based on the value
1049 of the window's _NET_WM_WINDOW_TYPE property as follows:
1050 .Pp
1051 .Bl -tag -width "_NET_WM_WINDOW_TYPE_TOOLBAR<TAB>XXX" -offset indent -compact
1052 .It _NET_WM_WINDOW_TYPE_DOCK
1053 FLOAT + ANYWHERE
1054 .It _NET_WM_WINDOW_TYPE_TOOLBAR
1055 FLOAT + ANYWHERE
1056 .It _NET_WM_WINDOW_TYPE_UTILITY
1057 FLOAT + ANYWHERE
1058 .It _NET_WM_WINDOW_TYPE_SPLASH
1059 FLOAT
1060 .It _NET_WM_WINDOW_TYPE_DIALOG
1061 FLOAT
1062 .El
1063 .Pp
1064 In all other cases, no automatic quirks are assigned to the window.
1065 Quirks specified in the configuration file override the automatic quirks.
1066 .Sh EWMH
1067 .Nm
1068 partially implements the Extended Window Manager Hints (EWMH) specification.
1069 This enables controlling windows as well as
1070 .Nm
1071 itself from external scripts and programs.
1072 This is achieved by
1073 .Nm
1074 responding to certain ClientMessage events.
1075 From the terminal these events
1076 can be conveniently sent using tools such as
1077 .Xr wmctrl 1
1078 and
1079 .Xr xdotool 1 .
1080 For the
1081 actual format of these ClientMessage events, see the EWMH specification.
1082 .Pp
1083 The id of the currently focused window is stored in the _NET_ACTIVE_WINDOW
1084 property of the root window.
1085 This can be used for example to retrieve the
1086 title of the currently active window with
1087 .Xr xprop 1
1088 and
1089 .Xr grep 1 :
1090 .Bd -literal -offset indent
1091 $ WINDOWID=`xprop \-root _NET_ACTIVE_WINDOW | grep \-o "0x.*"`
1092 $ xprop \-id $WINDOWID _NET_WM_NAME | grep \-o "\\".*\\""
1093 .Ed
1094 .Pp
1095 A window can be focused by sending a _NET_ACTIVE_WINDOW client message
1096 to the root window.
1097 For example, using
1098 .Xr wmctrl 1
1099 to send the message
1100 (assuming 0x4a0000b is the id of the window to be focused):
1101 .Bd -literal -offset indent
1102 $ wmctrl \-i \-a 0x4a0000b
1103 .Ed
1104 .Pp
1105 Windows can be closed by sending a _NET_CLOSE_WINDOW client message
1106 to the root window.
1107 For example, using
1108 .Xr wmctrl 1
1109 to send the message
1110 (assuming 0x4a0000b is the id of the window to be closed):
1111 .Bd -literal -offset indent
1112 $ wmctrl \-i \-c 0x4a0000b
1113 .Ed
1114 .Pp
1115 Windows can be floated and un-floated by adding or removing the
1116 _NET_WM_STATE_ABOVE atom from the _NET_WM_STATE property of the window.
1117 This can be achieved by sending a _NET_WM_STATE client message to the
1118 root window.
1119 For example, the following toggles the floating state of
1120 a window using
1121 .Xr wmctrl 1
1122 to send the message (assuming 0x4a0000b is the id of the window to be
1123 floated or un-floated):
1124 .Bd -literal -offset indent
1125 $ wmctrl \-i \-r 0x4a0000b \-b toggle,_NET_WM_STATE_ABOVE
1126 .Ed
1127 .Pp
1128 Windows can also be iconified and un-iconified by substituting
1129 _NET_WM_STATE_HIDDEN for _NET_WM_STATE_ABOVE in the previous example:
1130 .Bd -literal -offset indent
1131 $ wmctrl \-i \-r 0x4a0000b \-b toggle,_NET_WM_STATE_HIDDEN
1132 .Ed
1133 .Pp
1134 Floating windows can also be resized and moved by sending a
1135 _NET_MOVERESIZE_WINDOW client message to the root window.
1136 For example,
1137 using
1138 .Xr wmctrl 1
1139 to send the message (assuming 0x4a0000b is the id of
1140 the window to be resize/moved):
1141 .Bd -literal -offset indent
1142 $ wmctrl \-i \-r 0x4a0000b \-e 0,100,50,640,480
1143 .Ed
1144 .Pp
1145 This moves the window to (100,50) and resizes it to 640x480.
1146 .Pp
1147 Any _NET_MOVERESIZE_WINDOW events received for stacked windows are ignored.
1148 .Sh SIGNALS
1149 Sending
1150 .Nm
1151 a HUP signal will restart it.
1152 .Sh FILES
1153 .Bl -tag -width "/etc/spectrwm.confXXX" -compact
1154 .It Pa ~/.spectrwm.conf
1155 .Nm
1156 user specific settings.
1157 .It Pa /etc/spectrwm.conf
1158 .Nm
1159 global settings.
1160 .El
1161 .Sh HISTORY
1162 .Nm
1163 was inspired by xmonad & dwm.
1164 .Sh AUTHORS
1165 .An -nosplit
1166 .Nm
1167 was written by:
1168 .Pp
1169 .Bl -tag -width "Ryan Thomas McBride Aq mcbride@countersiege.com " -offset \
1170 indent -compact
1171 .It Cm Marco Peereboom Aq marco@peereboom.us
1172 .It Cm Ryan Thomas McBride Aq mcbride@countersiege.com
1173 .It Cm Darrin Chandler Aq dwchandler@stilyagin.com
1174 .It Cm Pierre-Yves Ritschard Aq pyr@spootnik.org
1175 .It Cm Tuukka Kataja Aq stuge@xor.fi
1176 .It Cm Jason L. Wright Aq jason@thought.net
1177 .It Cm Reginald Kennedy Aq rk@rejii.com
1178 .It Cm Lawrence Teo Aq lteo@lteo.net
1179 .It Cm Tiago Cunha Aq tcunha@gmx.com
1180 .It Cm David Hill Aq dhill@mindcry.org
1181 .El