JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Add new options to change focus behavior on window open and close.
[spectrwm.git] / spectrwm.1
1 .\" Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
2 .\" Copyright (c) 2009 Darrin Chandler <dwchandler@stilyagin.com>
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd $Mdocdate: February 15 2012 $
17 .Dt SPECTRWM 1
18 .Os
19 .Sh NAME
20 .Nm spectrwm
21 .Nd window manager for X11
22 .Sh SYNOPSIS
23 .Nm spectrwm
24 .Sh DESCRIPTION
25 .Nm
26 is a minimalistic window manager that tries to stay out of the way so that
27 valuable screen real estate can be used for much more important stuff.
28 It has sane defaults and does not require one to learn a language to do any
29 configuration.
30 It was written by hackers for hackers and it strives to be small, compact and
31 fast.
32 .Pp
33 When
34 .Nm
35 starts up, it reads settings from its configuration file,
36 .Pa spectrwm.conf .
37 See the
38 .Sx CONFIGURATION FILES
39 section below.
40 .Pp
41 The following notation is used throughout this page:
42 .Pp
43 .Bl -tag -width Ds -offset indent -compact
44 .It Cm M
45 Meta
46 .It Cm S
47 Shift
48 .It Aq Cm Name
49 Named key
50 .It Cm M1
51 Mouse button 1
52 .It Cm M3
53 Mouse button 3
54 .El
55 .Pp
56 .Nm
57 is very simple in its use.
58 Most of the actions are initiated via key or mouse bindings.
59 See the
60 .Sx BINDINGS
61 section below for defaults and customizations.
62 .Sh CONFIGURATION FILES
63 .Nm
64 first tries to open the user specific file,
65 .Pa ~/.spectrwm.conf .
66 If that file is unavailable,
67 it then tries to open the global configuration file
68 .Pa /etc/spectrwm.conf .
69 .Pp
70 The format of the file is \*(Ltkeyword\*(Gt = \*(Ltsetting\*(Gt.
71 For example:
72 .Pp
73 .Dl color_focus = red
74 .Pp
75 Enabling or disabling an option is done by using 1 or 0 respectively.
76 .Pp
77 The file supports the following keywords:
78 .Bl -tag -width 2m
79 .It Ic autorun
80 Launch an application in a specified workspace at start-of-day.
81 Defined in the format ws[<idx>]:application, e.g. ws[2]:xterm launches an
82 xterm in workspace 2.
83 .It Ic bar_action
84 External script that populates additional information in the status bar,
85 such as battery life.
86 .It Ic bar_at_bottom
87 Place the statusbar at the bottom of each region instead of the top.
88 .It Ic bar_border Ns Bq Ar x
89 Color of the status bar border in screen
90 .Ar x .
91 .It Ic bar_border_width
92 Set status bar border thickness in pixels.
93 Disable border by setting to 0.
94 .It Ic bar_color Ns Bq Ar x
95 Color of the status bar window in screen
96 .Ar x .
97 .It Ic bar_delay
98 Update frequency, in seconds, of external script that populates the status bar.
99 .It Ic bar_enabled
100 Enable or disable status bar.
101 .It Ic bar_font
102 Status bar font.
103 .It Ic bar_font_color Ns Bq Ar x
104 Color of the font in status bar in screen
105 .Ar x .
106 .It Ic bar_justify
107 Justify the status bar text. Possible values are
108 .Pa left ,
109 .Pa center ,
110 and
111 .Pa right .
112 .It Ic bind Ns Bq Ar x
113 Bind key combo to action
114 .Ar x .
115 See the
116 .Sx BINDINGS
117 section below.
118 .It Ic border_width
119 Set window border thickness in pixels.
120 Disable all borders by setting to 0.
121 .It Ic clock_enabled
122 Enable or disable displaying the clock in the status bar.
123 Disable by setting to 0
124 so a custom clock could be used in the
125 .Pa bar_action
126 script.
127 .It Ic color_focus
128 Border color of the currently focussed window.
129 .It Ic color_unfocus
130 Border color of unfocussed windows.
131 .It Ic dialog_ratio
132 Some applications have dialogue windows that are too small to be useful.
133 This ratio is the screen size to what they will be resized.
134 For example, 0.6 is 60% of the physical screen size.
135 .It Ic disable_border
136 Remove border when bar is disabled and there is only one window on the screen.
137 .It Ic focus_close
138 Window to put focus when the focused window is closed.
139 Possible values are
140 .Pa first ,
141 .Pa next ,
142 .Pa previous
143 (default) and
144 .Pa last .
145 .Pa next
146 and
147 .Pa previous
148 are relative to the window that is closed.
149 .It Ic focus_close_wrap
150 Whether to allow the focus to jump to the last window when the first window is
151 closed or vice versa.
152 Disable by setting to 0.
153 .It Ic focus_default
154 Window to put focus when no window has been focused.
155 Possible values are
156 .Pa first
157 and
158 .Pa last
159 (default).
160 .It Ic focus_mode
161 Using a value of
162 .Pa follow_cursor
163 will make the window manager focus the window
164 under the mouse when switching workspaces and creating windows.
165 .It Ic keyboard_mapping
166 Clear all key bindings and load new key bindings from the specified file.
167 This allows you to load pre-defined key bindings for your keyboard layout.
168 See the
169 .Sx KEYBOARD MAPPING FILES
170 section below for a list of keyboard mapping files that have been provided
171 for several keyboard layouts.
172 .It Ic layout
173 Select layout to use at start-of-day.
174 Defined in the format
175 ws[idx]:master_grow:master_add:stack_inc:layout:always_raise:stack_mode, e.g.
176 ws[2]:-4:0:1:0:horizontal sets worskspace 2 to the horizontal stack mode and
177 shrinks the master area by 4 ticks and adds one window to the stack, while
178 maintaining default floating window behavior.
179 Possible stack_mode values are
180 .Pa vertical ,
181 .Pa horizontal
182 and
183 .Pa fullscreen .
184 .Pp
185 See
186 .Pa master_grow ,
187 .Pa master_shrink ,
188 .Pa master_add ,
189 .Pa master_del ,
190 .Pa stack_inc ,
191 .Pa stack_dec ,
192 and
193 .Pa always_raise
194 for more information.
195 Note that the stacking options are complicated and have side-effects.
196 One should familiarize oneself with these commands before experimenting with the
197 .Pa layout
198 option.
199 .Pp
200 This setting is not retained at restart.
201 .It Ic modkey
202 Change mod key.
203 Mod1 is generally the ALT key and Mod4 is the windows key on a PC.
204 .It Ic program Ns Bq Ar p
205 Define new action to spawn a program
206 .Ar p .
207 See the
208 .Sx PROGRAMS
209 section below.
210 .It Ic quirk Ns Bq Ar c:n
211 Add "quirk" for windows with class
212 .Ar c
213 and name
214 .Ar n .
215 See the
216 .Sx QUIRKS
217 section below.
218 .It Ic region
219 Allocates a custom region, removing any autodetected regions which occupy the same
220 space on the screen.
221 Defined in the format screen[<idx>]:WIDTHxHEIGHT+X+Y,
222 e.g.\& screen[1]:800x1200+0+0.
223 .Pp
224 To make a screen span multiple monitors, create a region big enough to cover
225 them all, e.g. screen[1]:2048x768+0+0 makes the screen span two monitors with
226 1024x768 resolution sitting one next to the other.
227 .It Ic spawn_position
228 Position in stack to place newly spawned windows.
229 Possible values are
230 .Pa first ,
231 .Pa next ,
232 .Pa previous
233 and
234 .Pa last
235 (default).
236 .Pa next
237 and
238 .Pa previous
239 are relative to the focused window.
240 .It Ic stack_enabled
241 Enable or disable displaying the current stacking algorithm in the status bar.
242 .It Ic term_width
243 Set a preferred minimum width for the terminal.
244 If this value is greater than 0,
245 .Nm
246 will attempt to adjust the font sizes in the terminal to keep the terminal
247 width above this number as the window is resized.
248 Only
249 .Xr xterm 1
250 is currently supported.
251 The
252 .Xr xterm 1
253 binary must not be setuid or setgid, which it is by default on most systems.
254 Users may need to set program[term] (see the
255 .Sx PROGRAMS
256 section) to use an alternate copy of the
257 .Xr xterm 1
258 binary without the setgid bit set.
259 .It Ic title_class_enabled
260 Enable or disable displaying the window class in the status bar.
261 Enable by setting to 1.
262 .It Ic title_name_enabled
263 Enable or disable displaying the window title in the status bar.
264 Enable by setting to 1.
265 .It Ic urgent_enabled
266 Enable or disable the urgency hint.
267 Note that many terminal emulators require this to be enabled for it to
268 propagate.
269 In xterm, for example, one needs to add the following line
270 .Pa xterm.urgentOnBell: true
271 to
272 .Pa .Xdefaults .
273 .It Ic verbose_layout
274 Enable or disable displaying the current master and stack values in the status
275 bar.
276 Enable by setting to 1.
277 .It Ic window_name_enabled
278 Enable or disable displaying the window name in the status bar.
279 Enable by setting to 1.
280 .It Ic workspace_limit
281 Set the total number of workspaces available.  Minimum is 1, maximum is 22.
282 .El
283 .Pp
284 Colors need to be specified per the
285 .Xr XQueryColor 3
286 specification and fonts need to be specified per the
287 .Xr XQueryFont 3
288 specification.
289 .Pp
290 To list the available fonts in your system see
291 .Xr fc-list 1
292 or
293 .Xr xlsfonts 1
294 manpages.
295 The
296 .Xr xfontsel 1
297 application can help you to show the X Logical Font Description ("XLFD") used
298 as setting in the keyword
299 .Pa bar_font .
300 .Sh PROGRAMS
301 .Nm
302 allows you to define custom actions to launch programs of your choice and then
303 bind them the same as with built-in actions.
304 See the
305 .Sx BINDINGS
306 section below.
307 .Pp
308 The default programs are described below:
309 .Pp
310 .Bl -tag -width "screenshot_wind" -offset indent -compact
311 .It Cm term
312 xterm
313 .It Cm screenshot_all
314 screenshot.sh full
315 .It Cm screenshot_wind
316 screenshot.sh window
317 .It Cm lock
318 xlock
319 .It Cm initscr
320 initscreen.sh
321 .It Cm menu
322 dmenu_run \-fn $bar_font \-nb $bar_color \-nf $bar_font_color \-sb $bar_border \-sf $bar_color
323 .El
324 .Pp
325 Custom programs in the configuration file are specified as follows:
326 .Pp
327 .Dl program[<name>] = <progpath> [<arg> [... <arg>]]
328 .Pp
329 .Aq name
330 is any identifier that does not conflict with a built-in action or keyword,
331 .Aq progpath
332 is the desired program, and
333 .Aq arg
334 is zero or more arguments to the program.
335 .Pp
336 The following variables represent settable values in
337 .Nm
338 (see the
339 .Sx CONFIGURATION FILES
340 section above),
341 and may be used in the
342 .Aq arg
343 fields and will be substituted for values at the time the program is spawned:
344 .Pp
345 .Bl -tag -width "$bar_font_color" -offset indent -compact
346 .It Cm $bar_border
347 .It Cm $bar_color
348 .It Cm $bar_font
349 .It Cm $bar_font_color
350 .It Cm $color_focus
351 .It Cm $color_unfocus
352 .El
353 .Pp
354 Example:
355 .Bd -literal -offset indent
356 program[ff] = /usr/local/bin/firefox http://spectrwm.org/
357 bind[ff] = Mod+Shift+b # Now Mod+Shift+B launches firefox
358 .Ed
359 .Pp
360 To undo the previous:
361 .Bd -literal -offset indent
362 bind[] = Mod+Shift+b
363 program[ff] =
364 .Ed
365 .Sh BINDINGS
366 .Nm
367 provides many functions (or actions) accessed via key or mouse bindings.
368 .Pp
369 The current mouse bindings are described below:
370 .Pp
371 .Bl -tag -width "M-j, M-<TAB>XXX" -offset indent -compact
372 .It Cm M1
373 Focus window
374 .It Cm M-M1
375 Move window
376 .It Cm M-M3
377 Resize window
378 .It Cm M-S-M3
379 Resize window while maintaining it centered
380 .El
381 .Pp
382 The default key bindings are described below:
383 .Pp
384 .Bl -tag -width "M-j, M-<TAB>XXXXXX" -offset indent -compact
385 .It Cm M-S- Ns Aq Cm Return
386 term
387 .It Cm M-p
388 menu
389 .It Cm M-S-q
390 quit
391 .It Cm M-q
392 restart
393 .It Cm M- Ns Aq Cm Space
394 cycle_layout
395 .It Cm M-S- Ns Aq Cm \e
396 flip_layout
397 .It Cm M-S- Ns Aq Cm Space
398 stack_reset
399 .It Cm M-h
400 master_shrink
401 .It Cm M-l
402 master_grow
403 .It Cm M-,
404 master_add
405 .It Cm M-.
406 master_del
407 .It Cm M-S-,
408 stack_inc
409 .It Cm M-S-.
410 stack_dec
411 .It Cm M- Ns Aq Cm Return
412 swap_main
413 .It Xo
414 .Cm M-j ,
415 .Cm M- Ns Aq Cm TAB
416 .Xc
417 focus_next
418 .It Xo
419 .Cm M-k ,
420 .Cm M-S- Ns Aq Cm TAB
421 .Xc
422 focus_prev
423 .It Cm M-m
424 focus_main
425 .It Cm M-S-j
426 swap_next
427 .It Cm M-S-k
428 swap_prev
429 .It Cm M-b
430 bar_toggle
431 .It Cm M-x
432 wind_del
433 .It Cm M-S-x
434 wind_kill
435 .It Cm M- Ns Aq Ar 1-9,0,F1-F12
436 .Pf ws_ Aq Ar 1-22
437 .It Cm M-S- Ns Aq Ar 1-9,0,F1-F12
438 .Pf mvws_ Ns Aq Ar 1-22
439 .It Cm M- Ns Aq Cm Right
440 ws_next
441 .It Cm M- Ns Aq Cm Left
442 ws_prev
443 .It Cm M- Ns Aq Cm Up
444 ws_next_all
445 .It Cm M- Ns Aq Cm Down
446 ws_prev_all
447 .It Cm M-a
448 ws_prior
449 .It Cm M-S- Ns Aq Cm Right
450 screen_next
451 .It Cm M-S- Ns Aq Cm Left
452 screen_prev
453 .It Cm M-s
454 screenshot_all
455 .It Cm M-S-s
456 screenshot_wind
457 .It Cm M-S-v
458 version
459 .It Cm M-t
460 float_toggle
461 .It Cm M-S- Ns Aq Cm Delete
462 lock
463 .It Cm M-S-i
464 initscr
465 .It Cm M-w
466 iconify
467 .It Cm M-S-w
468 uniconify
469 .It Cm M-S-r
470 always_raise
471 .It Cm M-v
472 button2
473 .It Cm M--
474 width_shrink
475 .It Cm M-=
476 width_grow
477 .It Cm M-S--
478 height_shrink
479 .It Cm M-S-=
480 height_grow
481 .It Cm M-[
482 move_left
483 .It Cm M-]
484 move_right
485 .It Cm M-S-[
486 move_up
487 .It Cm M-S-]
488 move_down
489 .It Cm M-S-/
490 name_workspace
491 .It Cm M-/
492 search_workspace
493 .It Cm M-f
494 search_win
495 .El
496 .Pp
497 The action names and descriptions are listed below:
498 .Pp
499 .Bl -tag -width "M-j, M-<TAB>XXXX" -offset indent -compact
500 .It Cm term
501 Spawn a new terminal
502 (see
503 .Sx PROGRAMS
504 above).
505 .It Cm menu
506 Menu
507 (see
508 .Sx PROGRAMS
509 above).
510 .It Cm quit
511 Quit
512 .Nm .
513 .It Cm restart
514 Restart
515 .Nm .
516 .It Cm cycle_layout
517 Cycle layout.
518 .It Cm flip_layout
519 Swap the master and stacking areas.
520 .It Cm stack_reset
521 Reset layout.
522 .It Cm master_shrink
523 Shrink master area.
524 .It Cm master_grow
525 Grow master area.
526 .It Cm master_add
527 Add windows to master area.
528 .It Cm master_del
529 Remove windows from master area.
530 .It Cm stack_inc
531 Add columns/rows to stacking area.
532 .It Cm stack_dec
533 Remove columns/rows from stacking area.
534 .It Cm swap_main
535 Move current window to master area.
536 .It Cm focus_next
537 Focus next window in workspace.
538 .It Cm focus_prev
539 Focus previous window in workspace.
540 .It Cm focus_main
541 Focus on main window in workspace.
542 .It Cm swap_next
543 Swap with next window in workspace.
544 .It Cm swap_prev
545 Swap with previous window in workspace.
546 .It Cm bar_toggle
547 Toggle status bar in all workspaces.
548 .It Cm wind_del
549 Delete current window in workspace.
550 .It Cm wind_kill
551 Destroy current window in workspace.
552 .It Cm ws_ Ns Ar n
553 Switch to workspace
554 .Ar n ,
555 where
556 .Ar n
557 is 1 through workspace_limit.
558 .It Cm mvws_ Ns Ar n
559 Move current window to workspace
560 .Ar n ,
561 where
562 .Ar n
563 is 1 through workspace_limit.
564 .It Cm ws_next
565 Switch to next workspace with a window in it.
566 .It Cm ws_prev
567 Switch to previous workspace with a window in it.
568 .It Cm ws_next_all
569 Switch to next workspace.
570 .It Cm ws_prev_all
571 Switch to previous workspace.
572 .It Cm ws_prior
573 Switch to last visited workspace.
574 .It Cm screen_next
575 Move pointer to next region.
576 .It Cm screen_prev
577 Move pointer to previous region.
578 .It Cm screenshot_all
579 Take screenshot of entire screen (if enabled)
580 (see
581 .Sx PROGRAMS
582 above).
583 .It Cm screenshot_wind
584 Take screenshot of selected window (if enabled)
585 (see
586 .Sx PROGRAMS
587 above).
588 .It Cm version
589 Toggle version in status bar.
590 .It Cm float_toggle
591 Toggle focused window between tiled and floating.
592 .It Cm lock
593 Lock screen
594 (see
595 .Sx PROGRAMS
596 above).
597 .It Cm initscr
598 Reinitialize physical screens
599 (see
600 .Sx PROGRAMS
601 above).
602 .It Cm iconify
603 Minimize (unmap) currently focused window.
604 .It Cm uniconify
605 Maximize (map) window returned by dmenu selection.
606 .It Cm always_raise
607 When set tiled windows are allowed to obscure floating windows.
608 .It Cm button2
609 Fake a middle mouse button click (mouse button 2).
610 .It Cm width_shrink
611 Shrink the width of a floating window.
612 .It Cm width_grow
613 Grow the width of a floating window.
614 .It Cm height_shrink
615 Shrink the height of a floating window.
616 .It Cm height_grow
617 Grow the height of a floating window.
618 .It Cm move_left
619 Move a floating window a step to the left.
620 .It Cm move_right
621 Move a floating window a step to the right.
622 .It Cm move_up
623 Move a floating window a step upwards.
624 .It Cm move_down
625 Move a floating window a step downwards.
626 .It Cm name_workspace
627 Name the current workspace.
628 .It Cm search_workspace
629 Search for a workspace.
630 .It Cm search_win
631 Search the windows in the current workspace.
632 .El
633 .Pp
634 Custom bindings in the configuration file are specified as follows:
635 .Pp
636 .Dl bind[<action>] = <keys>
637 .Pp
638 .Aq action
639 is one of the actions listed above (or empty) and
640 .Aq keys
641 is in the form of zero or more modifier keys
642 (MOD, Mod1, Shift, etc.) and one or more normal keys
643 (b, space, etc.), separated by "+".
644 For example:
645 .Bd -literal -offset indent
646 bind[reset] = Mod4+q # bind Windows-key + q to reset
647 bind[] = Mod1+q # unbind Alt + q
648 .Ed
649 .Pp
650 To use the currently defined
651 .Ic modkey ,
652 specify MOD as the modifier key.
653 .Pp
654 Multiple key combinations may be bound to the same action.
655 .Pp
656 To bind non-latin characters such as å or π you must enter the xkb
657 character name instead of the character itself. Run xev, focus the window
658 and press the specific key and in the terminal output read the symbol name.
659 In the fallowing example for å:
660 .Bd -literal -offset indent
661 KeyPress event, serial 41, synthetic NO, window 0x2600001,
662     root 0x15a, subw 0x0, time 106213808, (11,5), root:(359,823),
663     state 0x0, keycode 24 (keysym 0xe5, aring), same_screen YES,
664     XLookupString gives 2 bytes: (c3 a5) "å"
665     XmbLookupString gives 2 bytes: (c3 a5) "å"
666     XFilterEvent returns: False
667 .Ed
668 .Pp
669 The xkb name is aring. In other words, in .spectrwm.conf add:
670 .Bd -literal -offset indent
671 bind[program] = MOD+aring
672 .Ed
673 .Sh KEYBOARD MAPPING FILES
674 Keyboard mapping files for several keyboard layouts are listed
675 below.
676 These files can be used with the
677 .Pa keyboard_mapping
678 setting to load pre-defined key bindings for the specified
679 keyboard layout.
680 .Pp
681 .Bl -tag -width "spectrwm_XX.confXXX" -offset indent -compact
682 .It Cm spectrwm_cz.conf
683 Czech Republic keyboard layout
684 .It Cm spectrwm_es.conf
685 Spanish keyboard layout
686 .It Cm spectrwm_fr.conf
687 French keyboard layout
688 .It Cm spectrwm_fr_ch.conf
689 Swiss French keyboard layout
690 .It Cm spectrwm_se.conf
691 Swedish keyboard layout
692 .It Cm spectrwm_us.conf
693 United States keyboard layout
694 .El
695 .Sh QUIRKS
696 .Nm
697 provides "quirks" which handle windows that must be treated specially
698 in a tiling window manager, such as some dialogs and fullscreen apps.
699 .Pp
700 The default quirks are described below:
701 .Pp
702 .Bl -tag -width "OpenOffice.org N.M:VCLSalFrame<TAB>XXX" -offset indent -compact
703 .It Firefox\-bin:firefox\-bin
704 TRANSSZ
705 .It Firefox:Dialog
706 FLOAT
707 .It Gimp:gimp
708 FLOAT + ANYWHERE
709 .It MPlayer:xv
710 FLOAT + FULLSCREEN + FOCUSPREV
711 .It OpenOffice.org 2.4:VCLSalFrame
712 FLOAT
713 .It OpenOffice.org 3.1:VCLSalFrame
714 FLOAT
715 .It pcb:pcb
716 FLOAT
717 .It xine:Xine Window
718 FLOAT + ANYWHERE
719 .It xine:xine Panel
720 FLOAT + ANYWHERE
721 .It xine:xine Video Fullscreen Window
722 FULLSCREEN + FLOAT
723 .It Xitk:Xitk Combo
724 FLOAT + ANYWHERE
725 .It Xitk:Xine Window
726 FLOAT + ANYWHERE
727 .It XTerm:xterm
728 XTERM_FONTADJ
729 .El
730 .Pp
731 The quirks themselves are described below:
732 .Pp
733 .Bl -tag -width "XTERM_FONTADJ<TAB>XXX" -offset indent -compact
734 .It FLOAT
735 This window should not be tiled, but allowed to float freely.
736 .It TRANSSZ
737 Adjusts size on transient windows that are too small using dialog_ratio
738 (see
739 .Sx CONFIGURATION FILES ) .
740 .It ANYWHERE
741 Allow window to position itself, uncentered.
742 .It XTERM_FONTADJ
743 Adjust xterm fonts when resizing.
744 .It FULLSCREEN
745 Remove border to allow window to use full screen size.
746 .It FOCUSPREV
747 On exit force focus on previously focused application not previous application
748 in the stack.
749 .El
750 .Pp
751 Custom quirks in the configuration file are specified as follows:
752 .Pp
753 .Dl quirk[<class>:<name>] = <quirk> [ + <quirk> ... ]
754 .Pp
755 .Aq class
756 and
757 .Aq name
758 specify the window to which the quirk(s) apply, and
759 .Aq quirk
760 is one of the quirks from the list above.
761 For example:
762 .Bd -literal -offset indent
763 quirk[MPlayer:xv] = FLOAT + FULLSCREEN + FOCUSPREV
764 quirk[pcb:pcb] = NONE  # remove existing quirk
765 .Ed
766 .Pp
767 You can obtain
768 .Aq class
769 and
770 .Aq name
771 by running
772 .Xr xprop 1
773 and then clicking on the desired window.
774 In the following example the main window of Firefox was clicked:
775 .Bd -literal -offset indent
776 $ xprop | grep WM_CLASS
777 WM_CLASS(STRING) = "Navigator", "Firefox"
778 .Ed
779 .Pp
780 Note that grepping for WM_CLASS flips class and name.
781 In the example above the quirk entry would be:
782 .Bd -literal -offset indent
783 quirk[Firefox:Navigator] = FLOAT
784 .Ed
785 .Pp
786 .Nm
787 also automatically assigns quirks to windows based on the value
788 of the window's _NET_WM_WINDOW_TYPE property as follows:
789 .Pp
790 .Bl -tag -width "_NET_WM_WINDOW_TYPE_TOOLBAR<TAB>XXX" -offset indent -compact
791 .It _NET_WM_WINDOW_TYPE_DOCK
792 FLOAT + ANYWHERE
793 .It _NET_WM_WINDOW_TYPE_TOOLBAR
794 FLOAT + ANYWHERE
795 .It _NET_WM_WINDOW_TYPE_UTILITY
796 FLOAT + ANYWHERE
797 .It _NET_WM_WINDOW_TYPE_SPLASH
798 FLOAT
799 .It _NET_WM_WINDOW_TYPE_DIALOG
800 FLOAT
801 .El
802 .Pp
803 In all other cases, no automatic quirks are assigned to the window.
804 Quirks specified in the configuration file override the automatic quirks.
805 .Sh EWMH
806 .Nm
807 partially implements the Extended Window Manager Hints (EWMH) specification.
808 This enables controlling windows as well as
809 .Nm
810 itself from external scripts and programs.
811 This is achieved by
812 .Nm
813 responding to certain ClientMessage events.
814 From the terminal these events
815 can be conveniently sent using tools such as
816 .Xr wmctrl 1
817 and
818 .Xr xdotool 1 .
819 For the
820 actual format of these ClientMessage events, see the EWMH specification.
821 .Pp
822 The id of the currently focused window is stored in the _NET_ACTIVE_WINDOW
823 property of the root window.
824 This can be used for example to retrieve the
825 title of the currently active window with
826 .Xr xprop 1
827 and
828 .Xr grep 1 :
829 .Bd -literal -offset indent
830 $ WINDOWID=`xprop \-root _NET_ACTIVE_WINDOW | grep \-o "0x.*"`
831 $ xprop \-id $WINDOWID WM_NAME | grep \-o "\\".*\\""
832 .Ed
833 .Pp
834 A window can be focused by sending a _NET_ACTIVE_WINDOW client message
835 to the root window.
836 For example, using
837 .Xr wmctrl 1
838 to send the message
839 (assuming 0x4a0000b is the id of the window to be focused):
840 .Bd -literal -offset indent
841 $ wmctrl \-i \-a 0x4a0000b
842 .Ed
843 .Pp
844 Windows can be closed by sending a _NET_CLOSE_WINDOW client message
845 to the root window.
846 For example, using
847 .Xr wmctrl 1
848 to send the message
849 (assuming 0x4a0000b is the id of the window to be closed):
850 .Bd -literal -offset indent
851 $ wmctrl \-i \-c 0x4a0000b
852 .Ed
853 .Pp
854 Windows can be floated and un-floated by adding or removing the
855 _NET_WM_STATE_ABOVE atom from the _NET_WM_STATE property of the window.
856 This can be achieved by sending a _NET_WM_STATE client message to the
857 root window.
858 For example, the following toggles the floating state of
859 a window using
860 .Xr wmctrl 1
861 to send the message (assuming 0x4a0000b is the  id of the window floated
862 or un-floated):
863 .Bd -literal -offset indent
864 $ wmctrl \-i \-r 0x4a0000b \-b toggle,_NET_WM_STATE_ABOVE
865 .Ed
866 .Pp
867 Floating windows can also be resized and moved by sending a
868 _NET_MOVERESIZE_WINDOW client message to the root window.
869 For example,
870 using
871 .Xr wmctrl 1
872 to send the message (assuming 0x4a0000b is the id of
873 the window to be resize/moved):
874 .Bd -literal -offset indent
875 $ wmctrl \-i \-r 0x4a0000b \-e 0,100,50,640,480
876 .Ed
877 .Pp
878 This moves the window to (100,50) and resizes it to 640x480.
879 .Pp
880 Any _NET_MOVERESIZE_WINDOW events received for stacked windows are ignored.
881 .Sh SIGNALS
882 Sending
883 .Nm
884 a HUP signal will restart it.
885 .Sh FILES
886 .Bl -tag -width "/etc/spectrwm.confXXX" -compact
887 .It Pa ~/.spectrwm.conf
888 .Nm
889 user specific settings.
890 .It Pa /etc/spectrwm.conf
891 .Nm
892 global settings.
893 .El
894 .Sh HISTORY
895 .Nm
896 was inspired by xmonad & dwm.
897 .Sh AUTHORS
898 .An -nosplit
899 .Nm
900 was written by:
901 .Pp
902 .Bl -tag -width "Ryan Thomas McBride Aq mcbride@countersiege.com " -offset indent -compact
903 .It Cm Marco Peereboom Aq marco@peereboom.us
904 .It Cm Ryan Thomas McBride Aq mcbride@countersiege.com
905 .It Cm Darrin Chandler Aq dwchandler@stilyagin.com
906 .It Cm Pierre-Yves Ritschard Aq pyr@spootnik.org
907 .It Cm Tuukka Kataja Aq stuge@xor.fi
908 .It Cm Jason L. Wright Aq jason@thought.net
909 .It Cm Reginald Kennedy Aq rk@rejii.com
910 .It Cm Lawrence Teo Aq lteo@lteo.net
911 .It Cm Tiago Cunha Aq tcunha@gmx.com
912 .El