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