Debian Codegraph @

modules/FvwmScript/Scripts/FvwmScript-ScreenSetup

raw
1 UseGettext
2 WindowLocaleTitle {Screen Setup}
3 WindowSize 695 400 # Taille
4 Font "xft:monospace:pixelsize=11;"
5
6 Init
7 Begin
8 WarpPointer 1
9
10 Set $FILE=(GetScriptArgument 1)
11 If $FILE=={} Then
12 Set $FILE={.xinitrc-fvwm}
13 Set $CAT={cat ~/} $FILE
14
15 #Screen Saver
16 Set $pos=0
17 Set $finish=1
18 While $finish=={1} Do
19 Begin
20 Set $pos=(Add $pos 1)
21 Set $tmp=(GetOutput {xset -q} $pos 1)
22 If $tmp=={Screen} Then
23 Set $finish=0
24 If $pos=={50} Then
25 Set $finish=0
26 End
27 If $pos=={50} Then
28 Begin
29 Do {Echo ScreenSetup: uncompatible xset}
30 #Quit
31 End
32 Set $pos=(Add $pos 1)
33 If (GetOutput {xset -q} $pos 3) == {yes} Then
34 ChangeValue 10 1
35 Else
36 ChangeValue 11 1
37 Set $pos=(Add $pos 1)
38 ChangeTitle 14 (GetOutput {xset -q} $pos 2)
39 ChangeTitle 15 (GetOutput {xset -q} $pos 4)
40
41 # Dpms
42 Set $pos=0
43 Set $finish=1
44 While $finish=={1} Do
45 Begin
46 Set $pos=(Add $pos 1)
47 Set $tmp=(GetOutput {xset -q} $pos 1)
48 If $tmp=={Font} Then
49 Set $finish=0
50 If $pos=={30} Then
51 Set $finish=0
52 End
53 If $pos=={50} Then
54 Begin
55 Do {Echo ScreenSetup: uncompatible xset}
56 Quit
57 End
58 Set $pos=(Add $pos 4)
59 ChangeTitle 63 (GetOutput {xset -q} $pos 2)
60 ChangeTitle 65 (GetOutput {xset -q} $pos 4)
61 ChangeTitle 67 (GetOutput {xset -q} $pos 6)
62 Set $pos=(Add $pos 1)
63 If (GetOutput {xset -q} $pos 3) == {Enabled} Then
64 ChangeValue 60 1
65 Else
66 ChangeValue 61 1
67
68 # Background
69 Set $pos=0
70 Set $finish=1
71 While $finish=={1} Do
72 Begin
73 Set $pos=(Add $pos 1)
74 Set $tmp=(GetOutput $CAT $pos 1)
75 If $tmp=={#ScreenMark} Then
76 Set $finish=0
77 If $pos=={50} Then
78 Set $finish=0
79 End
80 ChangeValue 4 0
81 ChangeValue 5 0
82 ChangeValue 50 1
83 Set $BColor={#0EC4B8}
84 ChangeTitle 7 {~/}
85 #ChangeIcon 8 /usr/include/X11/pixmaps/fvwm2.xpm
86 Set $pos=(Add $pos 1)
87 Set $test=(GetOutput $CAT $pos 1)
88 If $test=={fvwm-root} Then
89 Begin
90 ChangeTitle 7 (GetOutput $CAT $pos 2)
91 ChangeIcon 8 (GetTitle 7)
92 ChangeValue 50 0
93 ChangeValue 5 1
94 End
95 If $test=={xsetroot} Then
96 Begin
97 Set $BColor=(StrCopy (GetOutput $CAT $pos 3) 2 8)
98 ChangeValue 4 1
99 ChangeValue 50 0
100 ChangeTitle 24 $BColor
101 ChangeBackColor 6 $BColor
102 ChangeValue 20 (HexToNum (StrCopy $BColor 2 3))
103 ChangeValue 21 (HexToNum (StrCopy $BColor 4 5))
104 ChangeValue 22 (HexToNum (StrCopy $BColor 6 7))
105 End
106 # xscreensaver
107 Set $pos=(Add $pos 3)
108 Set $xsstest=(GetOutput $CAT $pos 1)
109 If $xsstest=={xscreensaver} Then
110 ChangeValue 72 1
111 End
112
113 PeriodicTasks
114 Begin
115 Set $MSG=(ReceivFromScript $BROWSER)
116 If $MSG <> {No message} Then
117 Begin
118 ChangeTitle 7 $MSG
119 ChangeIcon 8 $MSG
120 End
121 End
122
123 #-----------------------------------------------------------------------------
124 # Ok, apply and cancel buttons
125
126 Widget 1
127 Property
128 Size 85 20
129 Position 110 355
130 Type PushButton
131 Flags NoReliefString
132 LocaleTitle {Apply}
133 Main
134 Case message of
135 SingleClic :
136 Begin
137 # Background
138 If (GetValue 5) == 1 Then
139 Do {Exec fvwm-root } (GetTitle 7)
140 If (GetValue 4) == 1 Then
141 Do {Exec xsetroot -solid "} $BColor {"}
142 # screen-saver
143 Do {Exec xset s } (GetTitle 14) { } (GetTitle 15)
144 If (GetValue 10)==1 Then
145 Do {Exec xset s blank}
146 Else
147 Do {Exec xset s noblank}
148 # dpms
149 If (GetValue 60)==1 Then
150 Do {Exec xset dpms } (GetTitle 63) { } (GetTitle 65) { } (GetTitle 67)
151 Else
152 Do {Exec xset -dpms}
153 # xscreensaver
154 If (GetValue 72) == 1 Then
155 Begin
156 Do {Exec xscreensaver-command -exit}
157 Do {Exec xscreensaver -no-splash&}
158 End
159 Else
160 Do {Exec exec xscreensaver-command -exit}
161 End
162 End
163
164 Widget 2
165 Property
166 Size 85 20
167 Position 305 355
168 Type PushButton
169 Flags NoReliefString
170 LocaleTitle {Save}
171 Main
172 Case message of
173 SingleClic :
174 Begin
175 WriteToFile $FILE {#ScreenMark}
176
177 # Background
178 If (GetValue 5)==1 Then
179 Begin
180 Do {Exec fvwm-root } (GetTitle 7)
181 WriteToFile $FILE {fvwm-root } (GetTitle 7)
182 End
183 If (GetValue 4)==1 Then
184 Begin
185 Do {Exec xsetroot -solid "} $BColor {"}
186 WriteToFile $FILE {xsetroot -solid "} $BColor {"}
187 End
188 If (GetValue 50)==1 Then
189 WriteToFile $FILE {#xsetroot -solid "} $BColor {"}
190
191 # saver
192 If (GetValue 10)==1 Then
193 Set $tmp2 = { s blank}
194 Else
195 Set $tmp2 = { s noblank}
196 Do {Exec xset s } (GetTitle 14) { } (GetTitle 15) $tmp2
197 WriteToFile $FILE {xset s } (GetTitle 14) { } (GetTitle 15) $tmp2
198
199 # dpms
200 If (GetValue 60)==1 Then
201 Begin
202 Do {Exec xset dpms } (GetTitle 63) { } (GetTitle 65) { } (GetTitle 67)
203 WriteToFile $FILE {xset dpms } (GetTitle 63) { } (GetTitle 65) { } (GetTitle 67)
204 End
205 Else
206 Begin
207 Do {Exec xset -dpms}
208 WriteToFile $FILE {xset -dpms}
209 End
210
211 # xscreensaver
212 If (GetValue 72) == 1 Then
213 Begin
214 Do {Exec xscreensaver-command -exit}
215 Do {Exec xscreensaver -no-splash&}
216 WriteToFile $FILE {xscreensaver -no-splash&}
217 End
218 Else
219 Begin
220 Do {Exec exec xscreensaver-command -exit}
221 WriteToFile $FILE {#xscreensaver}
222 End
223
224 Do {Exec chmod +x } $FILE
225 #Quit
226 End
227 End
228
229 Widget 3
230 Property
231 Size 85 20
232 Position 500 355
233 Type PushButton
234 Flags NoReliefString
235 LocaleTitle {Quit}
236 Main
237 Case message of
238 SingleClic :
239 Begin
240 Quit
241 End
242 End
243
244 #----------------------------------------------------------------------------
245 # Left rectangle
246
247 Widget 16
248 Property
249 Size 410 330
250 Position 10 13
251 Type Rectangle
252 Main
253 Case message of
254 SingleClic :
255 Begin
256 End
257 End
258
259 Widget 18
260 Property
261 Position 15 5
262 Type ItemDraw
263 Flags NoReliefString NoFocus
264 LocaleTitle {Background}
265 Main
266 Case message of
267 SingleClic :
268 Begin
269 End
270 End
271
272 #---------- Uniform color
273
274 Widget 4
275 Property
276 Position 30 30
277 Type RadioButton
278 Flags NoReliefString
279 LocaleTitle {Uniform color:}
280 Main
281 Case message of
282 SingleClic :
283 Begin
284 ChangeValue 4 1
285 ChangeValue 5 0
286 ChangeValue 50 0
287 End
288 End
289
290 Widget 6
291 Property
292 Size 50 50
293 Position 60 80
294 Flags NoFocus
295 Type ItemDraw
296 BackColor {#0EC4B8}
297 Main
298 Case message of
299 SingleClic :
300 Begin
301 End
302 End
303
304 Widget 23
305 Property
306 Size 60 60
307 Position 55 75
308 Type Rectangle
309 Main
310 Case message of
311 SingleClic :
312 Begin
313 End
314 End
315
316 Widget 24
317 Property
318 Size 50 50
319 Position 58 140
320 Type ItemDraw
321 Flags NoReliefString NoFocus
322 Title {#0EC4B8}
323 Main
324 Case message of
325 SingleClic :
326 Begin
327 End
328 End
329
330 Widget 20
331 Property
332 Size 200 20
333 Position 195 20
334 Type HScrollBar
335 Flags NoReliefString
336 Value 14
337 MinValue 0
338 MaxValue 255
339 Main
340 Case message of
341 SingleClic :
342 Begin
343 Set $BColor = {#} (NumToHex (GetValue 20) 2) (NumToHex (GetValue 21) 2) (NumToHex (GetValue 22) 2)
344 ChangeTitle 24 $BColor
345 ChangeBackColor 6 $BColor
346 End
347 End
348
349 Widget 21
350 Property
351 Size 200 20
352 Position 195 75
353 Type HScrollBar
354 Flags NoReliefString
355 Value 196
356 MinValue 0
357 MaxValue 255
358 Main
359 Case message of
360 SingleClic :
361 Begin
362 Set $BColor = {#} (NumToHex (GetValue 20) 2) (NumToHex (GetValue 21) 2) (NumToHex (GetValue 22) 2)
363 ChangeTitle 24 $BColor
364 ChangeBackColor 6 $BColor
365 End
366 End
367
368 Widget 22
369 Property
370 Size 200 20
371 Position 195 130
372 Type HScrollBar
373 Flags NoReliefString
374 Value 184
375 MinValue 0
376 MaxValue 255
377 Main
378 Case message of
379 SingleClic :
380 Begin
381 Set $BColor = {#} (NumToHex (GetValue 20) 2) (NumToHex (GetValue 21) 2) (NumToHex (GetValue 22) 2)
382 ChangeTitle 24 $BColor
383 ChangeBackColor 6 $BColor
384 End
385 End
386
387 #--------- Pixmaps
388
389 Widget 5
390 Property
391 Position 30 220
392 Type RadioButton
393 Flags NoReliefString
394 LocaleTitle {Pixmap:}
395 Main
396 Case message of
397 SingleClic :
398 Begin
399 ChangeValue 4 0
400 ChangeValue 5 1
401 ChangeValue 50 0
402 End
403 End
404
405 Widget 7
406 Property
407 Size 230 30
408 Position 30 280
409 Type TextField
410 Flags NoReliefString
411 Title {~/}
412 Main
413 Case message of
414 SingleClic :
415 Begin
416 ChangeIcon 8 (GetTitle 7)
417 End
418 End
419
420 Widget 25
421 Property
422 Position 300 279
423 Type PushButton
424 Flags NoReliefString
425 LocaleTitle {Browser...}
426 Main
427 Case message of
428 SingleClic :
429 Begin
430 Set $ARG={FvwmScript-FileBrowser } (GetTitle 7) { Hello word}
431 Set $BROWSER=(LaunchScript $ARG )
432 End
433 End
434
435 Widget 8
436 Property
437 Size 175 75
438 Position 120 195
439 Flags NoReliefString NoFocus
440 Type ItemDraw
441 Icon /usr/X11/include/X11/pixmaps/fvwm2.xpm
442 Main
443 Case message of
444 SingleClic :
445 Begin
446 End
447 End
448
449 Widget 9
450 Property
451 Size 179 79
452 Position 118 193
453 Type Rectangle
454 Main
455 Case message of
456 SingleClic :
457 Begin
458 End
459 End
460
461 #--------- Disabled
462
463 Widget 50
464 Property
465 Position 30 320
466 Type RadioButton
467 Flags NoReliefString
468 LocaleTitle {Disable xinit background}
469 Main
470 Case message of
471 SingleClic :
472 Begin
473 ChangeValue 4 0
474 ChangeValue 5 0
475 ChangeValue 50 1
476 End
477 End
478
479 #----------------------------------------------------------------------------
480 # Right up rectangle
481
482
483 Widget 17
484 Property
485 Size 260 105
486 Position 425 13
487 Type Rectangle
488 Main
489 Case message of
490 SingleClic :
491 Begin
492 End
493 End
494
495 Widget 19
496 Property
497 Position 430 5
498 Type ItemDraw
499 Flags NoReliefString NoFocus
500 LocaleTitle {Screen-saver}
501 Main
502 Case message of
503 SingleClic :
504 Begin
505 End
506 End
507
508
509 Widget 10
510 Property
511 Position 430 40
512 Type RadioButton
513 Flags NoReliefString
514 LocaleTitle {Blank}
515 Main
516 Case message of
517 SingleClic :
518 Begin
519 ChangeValue 11 0
520 End
521 End
522
523 Widget 12
524 Property
525 Position 520 40
526 Type ItemDraw
527 Flags NoReliefString NoFocus
528 LocaleTitle {Timeout(s):}
529 Main
530 Case message of
531 SingleClic :
532 Begin
533 End
534 End
535
536 Widget 14
537 Property
538 Size 60 79
539 Position 615 37
540 Flags NoReliefString
541 Type TextField
542 Main
543 Case message of
544 SingleClic :
545 Begin
546 End
547 End
548
549 Widget 11
550 Property
551 Position 430 85
552 Type RadioButton
553 Flags NoReliefString
554 LocaleTitle {Pattern}
555 Main
556 Case message of
557 SingleClic :
558 Begin
559 ChangeValue 10 0
560 End
561 End
562
563
564 Widget 13
565 Property
566 Position 520 85
567 Type ItemDraw
568 Flags NoReliefString NoFocus
569 LocaleTitle {Cycle(s):}
570 Main
571 Case message of
572 SingleClic :
573 Begin
574 ChangeValue 10 0
575 End
576 End
577
578 Widget 15
579 Property
580 Size 60 79
581 Position 615 82
582 Flags NoReliefString
583 Type TextField
584 Main
585 Case message of
586 SingleClic :
587 Begin
588 ChangeValue 10 0
589 End
590 End
591
592
593 #----------------------------------------------------------------------------
594 # Right middle rectangle
595
596
597 Widget 57
598 Property
599 Size 260 135
600 Position 425 128
601 Type Rectangle
602 Main
603 Case message of
604 SingleClic :
605 Begin
606 End
607 End
608
609 Widget 59
610 Property
611 Position 430 120
612 Type ItemDraw
613 Flags NoReliefString NoFocus
614 LocaleTitle {DPMS}
615 Main
616 Case message of
617 SingleClic :
618 Begin
619 End
620 End
621
622
623 Widget 60
624 Property
625 Position 440 150
626 Type RadioButton
627 Flags NoReliefString
628 LocaleTitle {Enable}
629 Main
630 Case message of
631 SingleClic :
632 Begin
633 ChangeValue 61 0
634 End
635 End
636
637
638 Widget 61
639 Property
640 Position 580 150
641 Type RadioButton
642 Flags NoReliefString
643 LocaleTitle {Disable}
644 Main
645 Case message of
646 SingleClic :
647 Begin
648 ChangeValue 60 0
649 End
650 End
651
652 Widget 62
653 Property
654 Position 440 180
655 Type ItemDraw
656 Flags NoReliefString NoFocus
657 LocaleTitle {Standby(s):}
658 Main
659 Case message of
660 SingleClic :
661 Begin
662 End
663 End
664
665 Widget 63
666 Property
667 Size 60 20
668 Position 560 177
669 Type TextField
670 Flags NoReliefString
671 LocaleTitle{1000}
672 Main
673 Case message of
674 SingleClic :
675 Begin
676 End
677 End
678
679 Widget 64
680 Property
681 Position 440 205
682 Type ItemDraw
683 Flags NoReliefString NoFocus
684 LocaleTitle {Suspend(s):}
685 Main
686 Case message of
687 SingleClic :
688 Begin
689 End
690 End
691
692 Widget 65
693 Property
694 Size 60 20
695 Position 560 202
696 Type TextField
697 Flags NoReliefString
698 Title{1000}
699 Main
700 Case message of
701 SingleClic :
702 Begin
703 End
704 End
705
706 Widget 66
707 Property
708 Position 440 230
709 Type ItemDraw
710 Flags NoReliefString NoFocus
711 LocaleTitle {Off(s):}
712 Main
713 Case message of
714 SingleClic :
715 Begin
716 End
717 End
718
719 Widget 67
720 Property
721 Size 60 20
722 Position 560 227
723 Type TextField
724 Flags NoReliefString
725 Title{1000}
726 Main
727 Case message of
728 SingleClic :
729 Begin
730 End
731 End
732
733 #----------------------------------------------------------------------------
734 # Right down rectangle
735
736
737 Widget 70
738 Property
739 Size 260 65
740 Position 425 278
741 Type Rectangle
742 Main
743 Case message of
744 SingleClic :
745 Begin
746 End
747 End
748
749 Widget 71
750 Property
751 Position 430 270
752 Type ItemDraw
753 Flags NoReliefString NoFocus
754 LocaleTitle {xscreensaver}
755 Main
756 Case message of
757 SingleClic :
758 Begin
759 End
760 End
761
762
763 Widget 72
764 Property
765 Position 440 298
766 Type CheckBox
767 Flags NoReliefString
768 LocaleTitle {Enable}
769 Main
770 Case message of
771 SingleClic :
772 Begin
773 If (GetValue 72) == 1 Then
774 Begin
775 Set $SSTIMOUT= (GetTitle 14)
776 Set $SSCYCLE= (GetTitle 15)
777 ChangeTitle 14 {0}
778 ChangeTitle 15 {0}
779 End
780 Else
781 Begin
782 ChangeTitle 14 $SSTIMOUT
783 ChangeTitle 15 $SSCYCLE
784 End
785 End
786 End
787
788
789 Widget 73
790 Property
791 Position 550 295
792 Type PushButton
793 Flags NoReliefString
794 LocaleTitle {Config and Demo}
795 Main
796 Case message of
797 SingleClic :
798 Begin
799 Do {Exec xscreensaver-command -prefs&}
800 End
801 End
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819