Propagate Layer changes via Style command on-the-fly.
[fvwm.git] / modules / FvwmForm / FvwmForm-RootCursor.pl
blob2066f62c4855c2a99d32a0739e95690d5c2e7a57
1 #!/usr/bin/perl
3 # Usage:
4 # perl FvwmForm-RootCursor.pl >FvwmForm-RootCursor
6 $CHOICES_IN_LINE = 5;
7 $CURSORFONT_H = "/usr/X11/include/X11/cursorfont.h";
9 die "Can't find cursorfont.h, tried '$CURSORFONT_H'.\n"
10 unless -r $CURSORFONT_H;
12 open(CFH, "<$CURSORFONT_H");
13 $cfContent = join('', <CFH>);
14 close(CFH);
16 @cursorFonts = $cfContent =~ /XC_([^\s]*)\s/sg;
17 @cursorFonts = grep(!/num_glyphs/, @cursorFonts);
19 $len = 0; map { $len = length if $len < length } @cursorFonts;
20 $include = "";
21 $count = $CHOICES_IN_LINE;
23 foreach (@cursorFonts) {
24 if ($count == $CHOICES_IN_LINE) {
25 $include .= "*FvwmForm-RootCursor: Line expand\n"; $count = 0;
27 $include .= sprintf("*FvwmForm-RootCursor: Choice cursor_font %-${len}s off \"%-${len}s\"\n", $_, $_);
28 $count++;
30 $include =~ s/(left_ptr\s+)off/$1on /s; # set default cursor
32 $_ = join('', <DATA>);
33 s/\@INCLUDE_STANDARD_CURSOR_FONTS@\n/$include/s;
34 print $_;
36 # ****************************************************************************
37 # Here is the actual FvwmForm-RootCursor template goes
38 __DATA__
39 # This form changes the root cursor font and color.
41 DestroyModuleConfig FvwmForm-RootCursor: *
42 *FvwmForm-RootCursor: WarpPointer
43 *FvwmForm-RootCursor: Font fixed
44 *FvwmForm-RootCursor: ButtonFont 6x13
46 *FvwmForm-RootCursor: Text "Cursor font"
47 *FvwmForm-RootCursor: Selection cursor_font single
49 @INCLUDE_STANDARD_CURSOR_FONTS@
51 *FvwmForm-RootCursor: Line expand
52 *FvwmForm-RootCursor: Text "Cursor inner color"
53 *FvwmForm-RootCursor: Line expand
55 *FvwmForm-RootCursor: Selection cursor_fg single
56 *FvwmForm-RootCursor: Line center
57 *FvwmForm-RootCursor: Choice cursor_fg black on " black "
58 *FvwmForm-RootCursor: Choice cursor_fg red off " red "
59 *FvwmForm-RootCursor: Choice cursor_fg green off " green "
60 *FvwmForm-RootCursor: Choice cursor_fg blue off " blue "
61 *FvwmForm-RootCursor: Choice cursor_fg bisque off " bisque "
62 *FvwmForm-RootCursor: Choice cursor_fg brown off " brown "
63 *FvwmForm-RootCursor: Choice cursor_fg gray off " gray "
64 *FvwmForm-RootCursor: Line center
65 *FvwmForm-RootCursor: Choice cursor_fg cyan off " cyan "
66 *FvwmForm-RootCursor: Choice cursor_fg violet off " violet "
67 *FvwmForm-RootCursor: Choice cursor_fg seagreen off " seagreen"
68 *FvwmForm-RootCursor: Choice cursor_fg navy off " navy "
69 *FvwmForm-RootCursor: Choice cursor_fg gold off " gold "
70 *FvwmForm-RootCursor: Choice cursor_fg yellow off " yellow "
71 *FvwmForm-RootCursor: Choice cursor_fg white off " white "
73 *FvwmForm-RootCursor: Line expand
74 *FvwmForm-RootCursor: Text "Cursor outer color"
75 *FvwmForm-RootCursor: Line expand
77 *FvwmForm-RootCursor: Selection cursor_bg single
78 *FvwmForm-RootCursor: Line center
79 *FvwmForm-RootCursor: Choice cursor_bg black off " black "
80 *FvwmForm-RootCursor: Choice cursor_bg red off " red "
81 *FvwmForm-RootCursor: Choice cursor_bg green off " green "
82 *FvwmForm-RootCursor: Choice cursor_bg blue off " blue "
83 *FvwmForm-RootCursor: Choice cursor_bg bisque off " bisque "
84 *FvwmForm-RootCursor: Choice cursor_bg brown off " brown "
85 *FvwmForm-RootCursor: Choice cursor_bg gray off " gray "
86 *FvwmForm-RootCursor: Line center
87 *FvwmForm-RootCursor: Choice cursor_bg cyan off " cyan "
88 *FvwmForm-RootCursor: Choice cursor_bg violet off " violet "
89 *FvwmForm-RootCursor: Choice cursor_bg seagreen off " seagreen"
90 *FvwmForm-RootCursor: Choice cursor_bg navy off " navy "
91 *FvwmForm-RootCursor: Choice cursor_bg gold off " gold "
92 *FvwmForm-RootCursor: Choice cursor_bg yellow off " yellow "
93 *FvwmForm-RootCursor: Choice cursor_bg white on " white "
95 *FvwmForm-RootCursor: Line expand
96 *FvwmForm-RootCursor: Line expand
98 *FvwmForm-RootCursor: Button continue " Set Root Cursor "
99 *FvwmForm-RootCursor: Command CursorStyle ROOT $(cursor_font!none) $(cursor_fg) $(cursor_bg)
100 *FvwmForm-RootCursor: Button quit " Finish " ^[
101 *FvwmForm-RootCursor: Command Nop