3 focus-link.pl - perl FvwmCommand script
7 -v show version number and exit.
9 This is a user programmable window focus script.
10 It requires FvwmCommand version 1.5 or later.
11 FvwmCommandS must be invoked from fvwm prior to this command.
13 This script can be invoked from a shell or from .fvwm2rc. For example.
15 AddToFunc "InitFunction"
16 + "I" Exec exec xcb -n 4 -l vertical -g 240x180-0+530
17 + "I" Exec sleep 2; $HOME/scripts/focus-link.pl
19 Sleep is used in order to avoid un-necessary reaction during initial
20 window creation. Note, fvwm itself continues to run during these 2 seconds.
22 Default behavior is listed below.
23 In order to change the behavior, modify user_function using user
26 When a window is opened up, focus the window and move the pointer
27 to it. The parent window regains focus when a window is closed.
28 Parenthood is determined when a window is opened. It is the last
29 focused window with the same X class.
31 #1 would not occur to AcroRead opening window.
33 #1 would not occur when SkipMapping is set and the window is the
34 only window of its class.
36 For Netscape find dialog window, addition to #1, resize the window
37 to 300x150 pixels and move it to East edge of the screen.
38 Download/upload windows will not be focused nor be in focus link
41 Move appletviewer to NorthWest corner.
43 Xterm won't focus back to its parent after closed.
45 When a window is de-iconified, focus it and move the pointer.
48 These are collection of functions a user can call from programmable
50 .SS move_window [<id>] <direction>
52 .SS move_window [<id>] <x> <y>
54 If <id> is prensent in hex format, then move <id> window.
55 Otherwise, move the window in question.
57 If <y> is present, move window to <x> <y> in percentage of screen.
59 If 'p' is appended to <width> or <height>, it specifies in
60 pixel count. And, if <width'p'> or <height'p'> is lead with '-',
61 it signifies that pixel count from right or bottom edge.
63 If <y> does not exist, <dir> must be one of North Northeast East
64 Southeast South Southwest West Northwest to move window to edge.
65 .SS resize_window [<id>] <width> <height>
67 Resize window to <width> and <height> in percentage of screen size.
69 If <id> is not null, resize <id>. Otherwise resize the
72 Letter 'p' can be appended to <width> and <height> to specify in
74 .SS focus_window [<id>]
76 If <id> is not null, focus on <id>.
77 Otherwise, focus on the window in question.
78 .SS warp_to_window [<id>] [<x> <y>]
80 Move pointer to window.
82 If <id> is a window id, warp to <id>.
83 Otherwise, warp to the window in question.
85 If <x> and <y> are present, warp to <x> and <y> percentage of window
86 size down and in from the upper left hand corner.
88 Letter 'p' can be appended to <width> and <height> to specify in pixel
90 .SS class_matches <class> [<resource>]
92 Check if window class and optional resource match.
94 If arg1 is present, and if class matches with <class> and resource
95 matches with <resource>, then return 1.
97 If arg1 is not present, and if class matches with <class> then
99 Otherwise, return null.
100 .SS window_flag [<id>] <flag>
102 Return 1 if <flag> is true in the window in question.
103 If <id> is not null, check on <id>. Otherwise check on the
105 <flag> must be a exact match to one of these:
138 .SS resource_matches <resource>
139 Check if window resource matches pattern <resource>.
140 If it matches, return 1.
141 Otherwise return null.
142 .SS action_was <action>
143 Check if <action> was taken place.
145 <action> must be a exact match to one of these:
162 .SS get_parent_window [<id>]
164 Return parent window id.
166 If <id> is not null, check on <id>. Otherwise check on the
168 .SS no_parent_window [<id>]
170 Return 1 if no parent window exits.
172 If <id> is not null, check on <id>. Otherwise check on the
176 Delete the window from link list
180 Toshi Isogai isogai@ucsub.colorado.edu