Debian Codegraph @

modules/FvwmScript/Scripts/FvwmScript-PointerSetup

raw
1 UseGettext
2 WindowLocaleTitle {Pointer Setup}
3 WindowSize 365 265 # Size
4 Font "xft:monospace:pixelsize=11;"
5
6 Init
7 Begin
8 WarpPointer 2
9
10 Set $FILE=(GetScriptArgument 1)
11 If $FILE=={} Then
12 Set $FILE={.xinitrc-fvwm}
13
14 Set $pos=0
15 Set $finish=1
16 While $finish=={1} Do
17 Begin
18 Set $pos=(Add $pos 1)
19 Set $tmp=(GetOutput {xset -q} $pos 1)
20 If $tmp=={Pointer} Then
21 Set $finish=0
22 If $pos=={50} Then
23 Set $finish=0
24 End
25 If $pos=={50} Then
26 Begin
27 Do {Exec sh -c "echo 'PointerSetup: uncompatible xset'"}
28 Quit
29 End
30 Set $pos=(Add $pos 1)
31 Set $tmp=(GetOutput {xset -q} $pos 2)
32 Set $pos2=1
33 While (StrCopy $tmp $pos2 $pos2)<>{/} Do
34 Set $pos2=(Add $pos2 1)
35 Set $pos2=(Add $pos2 -1)
36
37 ChangeValue 6 (Div (Mult (StrCopy $tmp 1 $pos2) 20) (StrCopy $tmp (Add $pos2 2) 256))
38 ChangeTitle 8 (GetOutput {xset -q} $pos 4)
39 End
40
41 Widget 1
42 Property
43 Size 85 20
44 Position 30 225
45 Flags NoReliefString
46 Type PushButton
47 LocaleTitle {Apply}
48 Main
49 Case message of
50 SingleClic :
51 Begin
52 Do {Exec xset m } (GetValue 6) {/20 } (GetTitle 8)
53 If (GetValue 4) == 1 Then
54 Do {Exec xmodmap -e "pointer = 1 2 3"}
55 Else
56 Do {Exec xmodmap -e "pointer = 3 2 1"}
57 End
58 End
59
60 Widget 2
61 Property
62 Size 85 25
63 Position 140 225
64 Flags NoReliefString
65 Type PushButton
66 LocaleTitle {Save}
67 Main
68 Case message of
69 SingleClic :
70 Begin
71 Do {Exec xset m } (GetValue 6) {/20 } (GetTitle 8)
72 WriteToFile $FILE {xset m } (GetValue 6) {/20 } (GetTitle 8)
73 If (GetValue 4) == 1 Then
74 Begin
75 Do {Exec xmodmap -e "pointer = 1 2 3"}
76 WriteToFile $FILE {xmodmap -e "pointer = 1 2 3"}
77 End
78 Else
79 Begin
80 Do {Exec xmodmap -e "pointer = 3 2 1"}
81 WriteToFile $FILE {xmodmap -e "pointer = 3 2 1"}
82 End
83 Do {Exec chmod +x ~/} $FILE
84 Quit
85 End
86 End
87
88 Widget 3
89 Property
90 Size 85 25
91 Position 250 225
92 Flags NoReliefString
93 Type PushButton
94 LocaleTitle {Quit}
95 Main
96 Case message of
97 SingleClic :
98 Begin
99 Quit
100 End
101 End
102
103 Widget 4
104 Property
105 Position 185 155
106 Flags NoReliefString
107 Type PopupMenu
108 LocaleTitle {Right-handed user|Left-handed user}
109 Value 1
110 Main
111 Case message of
112 SingleClic :
113 Begin
114 End
115 End
116
117 Widget 5
118 Property
119 Position 20 160
120 Flags NoReliefString NoFocus
121 Type ItemDraw
122 LocaleTitle {Mouse configuration:}
123 Main
124 Case message of
125 SingleClic :
126 Begin
127 End
128 End
129
130 Widget 6
131 Property
132 Size 188 1
133 Position 150 25
134 Flags NoReliefString
135 MinValue 5
136 MaxValue 100
137 Type HScrollBar
138 Main
139 Case message of
140 SingleClic :
141 Begin
142 End
143 End
144
145 Widget 7
146 Property
147 Position 20 45
148 Flags NoReliefString NoFocus
149 Type ItemDraw
150 LocaleTitle {Acceleration:}
151 Main
152 Case message of
153 SingleClic :
154 Begin
155 End
156 End
157
158 Widget 8
159 Property
160 Size 60 1
161 Position 185 100
162 Flags NoReliefString
163 Type TextField
164 Main
165 Case message of
166 SingleClic :
167 Begin
168 End
169 End
170
171 Widget 9
172 Property
173 Size 110 1
174 Position 20 105
175 Flags NoReliefString NoFocus
176 Type ItemDraw
177 LocaleTitle {Threshold (pixels):}
178 Main
179 Case message of
180 SingleClic :
181 Begin
182 End
183 End
184
185 Widget 10
186 Property
187 Size 345 205
188 Position 10 10
189 Type Rectangle
190 Main
191 Case message of
192 SingleClic :
193 Begin
194 End
195 End
196
197 Widget 11
198 Property
199 Position 15 3
200 Flags NoReliefString NoFocus
201 Type ItemDraw
202 LocaleTitle {Pointer}
203 Main
204 Case message of
205 SingleClic :
206 Begin
207 End
208 End