WindowTitle {Setup 95}
WindowSize 610 360		# Taille
Font		-adobe-helvetica-bold-r-*-*-12-*

Init
 Begin

   HideWidget 2
   HideWidget 1
   HideWidget 80
   HideWidget 81
   HideWidget 82
   HideWidget 71
   HideWidget 5

   HideWidget 17
   HideWidget 18
   HideWidget 47
   HideWidget 48
   HideWidget 49
   HideWidget 35
   HideWidget 36
   HideWidget 37
   HideWidget 38
   HideWidget 39
   HideWidget 40
   HideWidget 41
   HideWidget 42
   HideWidget 43
   HideWidget 44
   HideWidget 45
   HideWidget 46

   HideWidget 50
   HideWidget 51
   HideWidget 52
   HideWidget 53
   HideWidget 54
   HideWidget 55
   HideWidget 57
   HideWidget 58
   HideWidget 59
   HideWidget 60
   HideWidget 61
   HideWidget 62
   HideWidget 63
   HideWidget 64

   Set $FDIR=(GetOutput  {echo "$FVWM_USERDIR"} 1 1)
   Set $OUTPUT=$FDIR {/.fvwm2rc}
   Set $T = $FDIR{/}
   ChangeTitle 11 $T
   
   Set $DATADIR = {/usr/local/share/fvwm}
   Set $INPUT = $DATADIR {/system.fvwm2rc-sample-95}
   Set $Perl = {/usr/bin/perl}
   Set $DefImagePath={/usr/include/X11/bitmaps:/usr/include/X11/pixmaps}

   # for Dan ImagePath :)
   Set $TIP=(StrCopy $DefImagePath  1  80)
   Set $tmp=(StrCopy $DefImagePath  81  81)
   If $tmp <> {} Then
      Set $TIP=$TIP{ ...}
   ChangeTitle 20 $TIP

   If $Perl == {} Then
   Begin
    If $FDIR<>{} Then
    Begin
      HideWidget 4
      HideWidget 19
      HideWidget 20
      HideWidget 21
      HideWidget 22
      HideWidget 24
      HideWidget 25
      HideWidget 26
      HideWidget 27
      HideWidget 29
      HideWidget 30
      HideWidget 31
      HideWidget 32
      HideWidget 33
    End
   End
   Else
   Begin
     HideWidget 90
     HideWidget 91
     HideWidget 92

     Set $SELEC = {0}  
    
     # Set the variables
     Set $IP=1
     Set $SoundPath={/usr/share/sounds/}
     Set $SoundPlayer = {rplay}

     Set $Fvwm = 0
     Set $Slow =0
     Set $Laptop = 0
     Set $KdeSysMenu = 0
     Set $KdeUserMenu = 0
     Set $KdeMenu = 0
     Set $GnomeSysMenu = 0
     Set $GnomeUserMenu = 0
     Set $GnomeRHMenu = 0
     Set $GnomeMenuGtk = 0
     Set $GnomeMenuFvwm = 1
     Set $GnomeSession = 0
     Set $GnomePath = {No}
     Set $GnomeY = 0
     Set $PanelStaysPut = 0
     Set $KfmIcons = 0
     Set $Cde = 0
   
     # Check for KDE
     Set $KdeY=(GetOutput {echo "$KDEDIR"} 1 1)
     If $KdeY == {} Then
       Set $KdeY = 0
     Else
       Set $KdeY = 1

     # Check for GNOME
     Set $CMD = {gd="No"; for dir in `echo $PATH| sed "s,:, ,g"`; do if [ -x "$dir/gnome-session" ]; then gd=$dir; fi; done; gd=`echo $gd| sed "s,/bin$,,"`; echo $gd}
     Set $GnomePath = (GetOutput $CMD 1 -1)
     If $GnomePath <> {No} Then
       Set $GnomeY = 1
     Set $CMD ={if fvwm-config --supports-gnome-hints; then echo "1"; else echo "0"; fi}
     Set $GnomeS = (GetOutput $CMD 1 -1)
     If $GnomeY == {0} Then
       Set $GnomeS = 0

     # Check for CDE
     Set $CMD = {if [ -d /usr/dt/ ]; then echo "1"; else echo "0"; fi}
     Set $Cde = (GetOutput $CMD 1 -1)
     If $Cde == {1} Then
	Set $CdeTitle={CDE has been detected, support will be added          }
     Else
	Set $CdeTitle={It does not seem that CDE is installed on your machine}
     ChangeTitle 64 $CdeTitle

     # Check for Stroke
     Set $CMD ={if fvwm-config --supports-stroke; then echo "1"; else echo "0"; fi}
     Set $Stroke = (GetOutput $CMD 1 -1)

   End
 End

PeriodicTasks
 Begin
  Set $IMSG=(ReceivFromScript $IBROWSER)
  If $IMSG <> {No message} Then
  Begin
   ChangeTitle 24 $IMSG
  End
  Set $SMSG=(ReceivFromScript $SBROWSER)
  If $SMSG <> {No message} Then
  Begin
   ChangeTitle 29 $SMSG
  End
 End

Widget 10
Property
 Position 10 10
 Flags NoReliefString
 Type ItemDraw
 Title {This Script creates configuration files (.fvwm2rc, bindings, decorations, functions, globalfeel,}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 14
Property
 Position 10 30
 Flags NoReliefString
 Type ItemDraw
 Title {menus, modules, startup, styles, iconstyles) and copies them to your FVWM_USERDIR directory:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 11
Property
 Position 10 47
 Flags NoReliefString
 Size 580 20
 Font fixed	
 Type ItemDraw
 Title {}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 12
Property
 Position 10 70
 Flags NoReliefString
 Type ItemDraw
 Title {If those files already exist they will be backed up in a subdirectory. Set your preferences:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 16
Property
 Size 590 210
 Position 10 95
 Type Rectangle
Main
 Case message of
  SingleClic :
  Begin
  End
End

#############################################################################
#ImagePath and Sound Path: First tableau

Widget 21
Property
 Position 20 100
 Flags NoReliefString
 Type ItemDraw
 Title {You should have a recent version of fvwm_icons installed. The builtin FVWM image path is:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 20
Property
 Position 20 118
 Flags NoReliefString
 Size 570 20
 Type ItemDraw
 Font fixed
 Title {}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 19
Property
 Position 20 140
 Flags NoReliefString
 Type ItemDraw
 Title {You can add another directory to this path if you want:}
Main
 Case message of
  SingleClic :
  Begin
  End
End


Widget 22
Property
 Position 20 165
 Flags NoReliefString
 Type PopupMenu
 Title {No|$HOME/icons/|$HOME/icons/fvwm/|$FVWM_USERDIR/images/|$FVWM_USERDIR/icons/|$HOME/fvwm-web/icons/|/usr/share/icons/|/usr/share/icons/fvwm/|/usr/local/share/icons/|/usr/local/share/icons/fvwm/}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 22) == 1 Then
    ChangeTitle 24 {No}
   If (GetValue 22) == 2 Then
    ChangeTitle 24 {$HOME/icons/}
   If (GetValue 22) == 3 Then
    ChangeTitle 24 {$HOME/icons/fvwm/}
   If (GetValue 22) == 4 Then
    ChangeTitle 24 {$FVWM_USERDIR/images/}
   If (GetValue 22) == 5 Then
    ChangeTitle 24 {$FVWM_USERDIR/icons/}
   If (GetValue 22) == 6 Then
    ChangeTitle 24 {$HOME/fvwm-web/icons/}
   If (GetValue 22) == 7 Then
    ChangeTitle 24 {/usr/share/icons/}
   If (GetValue 22) == 8 Then
    ChangeTitle 24 {/usr/share/icons/fvwm/}
   If (GetValue 22) == 9 Then
    ChangeTitle 24 {/usr/local/share/icons/}
   If (GetValue 22) == 10 Then
    ChangeTitle 24 {/usr/local/share/icons/fvwm}
  End
End

Widget 24
Property
 Size 250 30
 Position 240 165
 Flags NoReliefString
 Type TextField
 Title {No}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 25
Property
 Position 510 165
 Flags NoReliefString
 Type PushButton
 Title {Browser...}
Main
 Case message of
  SingleClic :
  Begin
   Set $TMP = (GetTitle 24)
   If $TMP=={No} Then
	Set $TMP = $FDIR
   Set $ARG={FvwmScript-FileBrowser } $TMP { I}
   Set $IBROWSER=(LaunchScript $ARG )
  End
End



Widget 26
Property
 Position 20 205
 Flags NoReliefString
 Type ItemDraw
 Title {For sound effects you need fvwm_sounds and an .au player. Set the fvwm_sounds directory:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 27
Property
 Position 20 230
 Flags NoReliefString
 Type PopupMenu
 Title {/usr/share/sounds/|/usr/share/sounds/fvwm/|/usr/local/share/sounds/|/usr/local/share/sounds/fvwm/|$HOME/sounds|$HOME/sounds/fvwm/|$FVWM_USERDIR/sounds/}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 27) == 1 Then
     ChangeTitle 29 {/usr/share/sounds/}
   If (GetValue 27) == 2 Then
     ChangeTitle 29 {/usr/share/sounds/fvwm/}
   If (GetValue 27) == 3 Then
     ChangeTitle 29 {/usr/local/share/sounds/}
   If (GetValue 27) == 4 Then
     ChangeTitle 29 {/usr/local/share/sounds/fvwm/}
   If (GetValue 27) == 5 Then
     ChangeTitle 29 {$HOME/sounds/}
   If (GetValue 27) == 6 Then
     ChangeTitle 29 {$HOME/sounds/fvwm/}
   If (GetValue 27) == 7 Then
     ChangeTitle 29 {$FVWM_USERDIR/sounds/}
  End
End

Widget 29
Property
 Size 250 30
 Position 240 230
 Flags NoReliefString
 Type TextField
 Title {/usr/share/sounds/}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 30
Property
 Position 510 230
 Flags NoReliefString
 Type PushButton
 Title {Browser...}
Main
 Case message of
  SingleClic :
  Begin
   Set $ARG={FvwmScript-FileBrowser } (GetTitle 29) { S}
   Set $SBROWSER=(LaunchScript $ARG )
  End
End

Widget 31
Property
 Position 20 275
 Flags NoReliefString
 Type ItemDraw
 Title {and choose a player:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 32
Property
 Position 175 270
 Flags NoReliefString
 Type PopupMenu
 Title {rplay|esdplay|audioplayer|auplay}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 32) == 1 Then
     ChangeTitle 33 {rplay}
   If (GetValue 32) == 2 Then
     ChangeTitle 33 {esdplay}
   If (GetValue 32) == 3 Then
     ChangeTitle 33 {audioplayer}
   If (GetValue 32) == 4 Then
     ChangeTitle 33 {auplay}
  End
End

Widget 33
Property
 Size 190 30
 Position 345 270
 Flags NoReliefString
 Type TextField
 Title {rplay}
Main
 Case message of
  SingleClic :
  Begin
  End
End

#############################################################################
# look and Preferred apps: Second Tableau

Widget 17
Property
 Position 20 110
 Flags NoReliefString
 Type ItemDraw
 Title {Look Preference:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 18
Property
 Position 155 105
 Flags NoReliefString
 Type PopupMenu
 Title {FVWM 95|FVWM}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 18) == 1 Then
     Set $Fvwm={0}
   If (GetValue 18) == 2 Then
     Set $Fvwm={1}
  End
End

Widget 47
Property
 Position 285 110
 Flags NoReliefString
 Type ItemDraw
 Title {Do you have a slow X server?}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 48
Property
 Title {No}
 Position 485 110
 Flags NoReliefString
 Type RadioButton
 Value 1
Main
 Case message of
  SingleClic :
  Begin
   ChangeValue 48 1
   ChangeValue 49 0
   Set $Slow={0}
  End
End

Widget 49
Property
 Title {Yes}
 Position 535 110
 Flags NoReliefString
 Type RadioButton
 Value 0
Main
 Case message of
  SingleClic :
  Begin
   ChangeValue 48 0
   ChangeValue 49 1
   Set $Slow={1}
  End
End

Widget 35
Property
 Position 20 155
 Flags NoReliefString
 Type ItemDraw
 Title {Preferred Editor:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 36
Property
 Position 155 150
 Flags NoReliefString
 Type PopupMenu
 Title {emacs|xemacs|gvim|nedit|xedit|gxedit|kwrite|dtpad}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 36) == 1 Then
    ChangeTitle 37 {emacs}
   If (GetValue 36) == 2 Then
    ChangeTitle 37 {xemacs}
   If (GetValue 36) == 3 Then
    ChangeTitle 37 {gvim}
   If (GetValue 36) == 4 Then
    ChangeTitle 37 {nedit}
   If (GetValue 36) == 5 Then
    ChangeTitle 37 {xedit}
   If (GetValue 36) == 6 Then
    ChangeTitle 37 {gxedit}
   If (GetValue 36) == 7 Then
    ChangeTitle 37 {kwrite}
   If (GetValue 36) == 8 Then
    ChangeTitle 37 {/usr/dt/bin/dtpad}
  End
End

Widget 37
Property
 Size 180 30
 Position 365 150
 Flags NoReliefString
 Type TextField
 Title {emacs}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 38
Property
 Position 20 190
 Flags NoReliefString
 Type ItemDraw
 Title {Preferred FileMgr:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 39
Property
 Position 155 185
 Flags NoReliefString
 Type PopupMenu
 Title {xfm|Midnight-Commander|File Runner|dfm|kfm|gmc|dtfile|kexplorer}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 39) == 1 Then
    ChangeTitle 40 {xfm}
   If (GetValue 39) == 2 Then
     ChangeTitle 40 {xterm -g 80x35 -e mc}
   If (GetValue 39) == 3 Then
     ChangeTitle 40 {fr}
   If (GetValue 39) == 4 Then
     ChangeTitle 40 {dfm}
   If (GetValue 39) == 5 Then
     ChangeTitle 40 {kfmclient openURL ~/}
   If (GetValue 39) == 6 Then
     ChangeTitle 40 {gmc}
   If (GetValue 39) == 7 Then
     ChangeTitle 40 {/usr/dt/bin/dtfile}
   If (GetValue 39) == 8 Then
     ChangeTitle 40 {kexplorer}
  End
End

Widget 40
Property
 Size 180 30
 Position 365 185
 Flags NoReliefString
 Type TextField
 Title {xfm}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 41
Property
 Position 20 225
 Flags NoReliefString
 Type ItemDraw
 Title {Preferred Terminal:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 42
Property
 Position 155 220
 Flags NoReliefString
 Type PopupMenu
 Title {xterm|nxterm|rxvt|Eterm|xiterm|aterm|kvt|konsole|gnome-terminal|dtterm}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 42) == 1 Then
    ChangeTitle 43 {xterm}
   If (GetValue 42) == 2 Then
    ChangeTitle 43 {nxterm}
   If (GetValue 42) == 3 Then
    ChangeTitle 43 {rxvt}
   If (GetValue 42) == 4 Then
    ChangeTitle 43 {Eterm}
   If (GetValue 42) == 5 Then
    ChangeTitle 43 {xiterm}
   If (GetValue 42) == 6 Then
    ChangeTitle 43 {aterm}
   If (GetValue 42) == 7 Then
    ChangeTitle 43 {kvt}
   If (GetValue 42) == 8 Then
    ChangeTitle 43 {konsole}
   If (GetValue 42) == 9 Then
    ChangeTitle 43 {gnome-terminal}
   If (GetValue 42) == 10 Then
    ChangeTitle 43 {/usr/dt/bin/dtterm}
  End
End

Widget 43
Property
 Size 180 30
 Position 365 220
 Flags NoReliefString
 Type TextField
 Title {xterm}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 44
Property
 Position 20 275
 Flags NoReliefString
 Type ItemDraw
 Title {Do you have a laptop (and xapm)?}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 45
Property
 Title {No}
 Position 250 275
 Flags NoReliefString
 Type RadioButton
 Value 1
Main
 Case message of
  SingleClic :
  Begin
   ChangeValue 45 1
   ChangeValue 46 0
   Set $Laptop={0}
  End
End

Widget 46
Property
 Title {Yes}
 Position 300 275
 Flags NoReliefString
 Type RadioButton
 Value 0
Main
 Case message of
  SingleClic :
  Begin
   ChangeValue 45 0
   ChangeValue 46 1
   Set $Laptop={1}
  End
End

#############################################
# Desktop options:

Widget 50
Property
 Position 20 100
 Flags NoReliefString
 Type ItemDraw
 Title {Desktop Options (GNOME, KDE & CDE)}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 51
Property
 Position 20 130
 Flags NoReliefString
 Type CheckBox
 Title {Add GNOME system menu}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 51) == 1 Then
    Set $GnomeSysMenu={1}
   Else
    Set $GnomeSysMenu={0}
  End
End


Widget 52
Property
 Position 275 130
 Flags NoReliefString
 Type CheckBox
 Title {Add GNOME user menu}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 52) == 1 Then
    Set $GnomeUserMenu={1}
   Else
    Set $GnomeUserMenu={0}
  End
End


Widget 53
Property
 Position 20 165
 Flags NoReliefString
 Type CheckBox
 Title {Add GNOME "RedHat" menu}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 53) == 1 Then
    Set $GnomeRHMenu={1}
   Else
    Set $GnomeRHMenu={0}
  End
End


Widget 54
Property
 Position 275 165
 Flags NoReliefString
 Type CheckBox
 Title {Use Gtk Menu instead of Fvwm menu}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 54) == 1 Then
   Begin
    Set $GnomeMenuGtk={1}
    Set $GnomeMenuFvwm={0}
   End
   Else
   Begin
    Set $GnomeMenuGtk={0}
    Set $GnomeMenuFvwm={1}
   End
  End
End

##### No gnome-session on the machine 
Widget 55
Property
 Position 20 150
 Flags NoReliefString
 Type ItemDraw
 Title {It does not seem that GNOME is installed on your machine}
Main
 Case message of
  SingleClic :
  Begin
  End
End


Widget 57
Property
 Position 20 200
 Flags NoReliefString
 Type CheckBox
 Title {Build a config for gnome-session}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 57) == 1 Then
    Set $GnomeSession={1}
   Else
    Set $GnomeSession={0}
  End
End

Widget 58
Property
 Position 275 200
 Flags NoReliefString
 Type CheckBox
 Title {Try a "stays put" panel (for gnome-session)}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 58) == 1 Then
    Set $PanelStaysPut={1}
   Else
    Set $PanelStaysPut={0}
  End
End

##### No FVWM support for gnome
Widget 59
Property
 Position 20 200
 Flags NoReliefString
 Type ItemDraw
 Title {Your FVWM version is built without support for GNOME hints}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 60
Property
 Position 20 240
 Flags NoReliefString
 Type CheckBox
 Title {Add KDE system menu}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 60) == 1 Then
    Set $KdeSysMenu={1}
   Else
    Set $KdeSysMenu={0}
  End
End


Widget 61
Property
 Position 210 240
 Flags NoReliefString
 Type CheckBox
 Title {Add KDE user menu}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 61) == 1 Then
    Set $KdeUserMenu={1}
   Else
    Set $KdeUserMenu={0}
  End
End

Widget 62
Property
 Position 400 240
 Flags NoReliefString
 Type CheckBox
 Title {Add support for KFM icons}
Main
 Case message of
  SingleClic :
  Begin
   If (GetValue 62) == 1 Then
    Set $KfmIcons={1}
   Else
    Set $KfmIcons={0}
  End
End

##### No KDE on the machine 
Widget 63
Property
 Position 20 240
 Flags NoReliefString
 Type ItemDraw
 Title {It does not seem that KDE is installed on your machine}
Main
 Case message of
  SingleClic :
  Begin
  End
End

########## CDE
Widget 64
Property
 Position 20 275
 Flags NoReliefString
 Type ItemDraw
 Title {It does not seem that CDE is installed on your machine}
Main
 Case message of
  SingleClic :
  Begin
  End
End

#############################################################################
# Ok, apply, cancel, next and previous

Widget 4
Property
 Size 30 30
 Position 350 320
 Flags NoReliefString
 Type PushButton
 Title {Next >>}
Main
 Case message of
  SingleClic :
  Begin
    If $SELEC <> {3} Then
      Set $SELEC = (Add $SELEC 1)
    If $SELEC == {1} Then
    Begin
      HideWidget 19
      HideWidget 20
      HideWidget 21
      HideWidget 22
      HideWidget 24
      HideWidget 25
      HideWidget 26
      HideWidget 27
      HideWidget 29
      HideWidget 30
      HideWidget 31
      HideWidget 32
      HideWidget 33
     
      ShowWidget 17
      ShowWidget 18
      ShowWidget 47
      ShowWidget 48
      ShowWidget 49
      ShowWidget 35
      ShowWidget 36
      ShowWidget 37
      ShowWidget 38
      ShowWidget 39
      ShowWidget 40
      ShowWidget 41
      ShowWidget 42
      ShowWidget 43
      ShowWidget 44
      ShowWidget 45
      ShowWidget 46

      ShowWidget 5
    End
    If $SELEC == {2} Then
    Begin
      ShowWidget 50

      If $GnomeY == {1} Then
      Begin
        ShowWidget 51
        ShowWidget 52
        ShowWidget 53
        ShowWidget 54
      End
      Else
        ShowWidget 55

      If $GnomeS == {1} Then
      Begin
        ShowWidget 57
        ShowWidget 58
      End
      Else
      Begin
        If $GnomeY == {1} Then
           ShowWidget 59
      End

      If $KdeY == {1} Then
      Begin
        ShowWidget 60
        ShowWidget 61
        ShowWidget 62
      End
      Else
        ShowWidget 63

      ShowWidget 64

      HideWidget 17
      HideWidget 18
      HideWidget 47
      HideWidget 48
      HideWidget 49
      HideWidget 35
      HideWidget 36
      HideWidget 37
      HideWidget 38
      HideWidget 39
      HideWidget 40
      HideWidget 41
      HideWidget 42
      HideWidget 43
      HideWidget 44
      HideWidget 45
      HideWidget 46
    End
    If $SELEC == {3} Then
    Begin
      HideWidget 50

      If $GnomeY == {1} Then
      Begin
        HideWidget 51
        HideWidget 52
        HideWidget 53
        HideWidget 54
      End
      Else
        HideWidget 55

      If $GnomeS == {1} Then
      Begin
        HideWidget 57
        HideWidget 58
      End
      Else
      Begin
        If $GnomeY == {1} Then
           HideWidget 59
      End

      If $KdeY == {1} Then
      Begin
        HideWidget 60
        HideWidget 61
        HideWidget 62
      End
      Else
        HideWidget 63

      HideWidget 64

      HideWidget 4
 
      ShowWidget 1
      ShowWidget 71
    End
  End
End

Widget 5
Property
 Size 30 30
 Position 200 320
 Flags NoReliefString
 Type PushButton
 Title {<< Previous}
Main
 Case message of
  SingleClic :
  Begin
    If $SELEC <> {0} Then
      Set $SELEC = (Add $SELEC -1)
    If $SELEC == {0} Then
    Begin
      ShowWidget 19
      ShowWidget 20
      ShowWidget 21
      ShowWidget 22
      ShowWidget 24
      ShowWidget 25
      ShowWidget 26
      ShowWidget 27
      ShowWidget 29
      ShowWidget 30
      ShowWidget 31
      ShowWidget 32
      ShowWidget 33

      HideWidget 17
      HideWidget 18
      HideWidget 47
      HideWidget 48
      HideWidget 49
      HideWidget 35
      HideWidget 36
      HideWidget 37
      HideWidget 38
      HideWidget 39
      HideWidget 40
      HideWidget 41
      HideWidget 42
      HideWidget 43
      HideWidget 44
      HideWidget 45
      HideWidget 46

      HideWidget 5
    End
    If $SELEC == {1} Then
    Begin
      HideWidget 50

      If $GnomeY == {1} Then
      Begin
        HideWidget 51
        HideWidget 52
        HideWidget 53
        HideWidget 54
      End
      Else
        HideWidget 55

      If $GnomeS == {1} Then
      Begin
        HideWidget 57
        HideWidget 58
      End
      Else
      Begin
        If $GnomeY == {1} Then
           HideWidget 59
      End

      If $KdeY == {1} Then
      Begin
        HideWidget 60
        HideWidget 61
        HideWidget 62
      End
      Else
        HideWidget 63

      HideWidget 64

      ShowWidget 17
      ShowWidget 18
      ShowWidget 35
      ShowWidget 36
      ShowWidget 47
      ShowWidget 48
      ShowWidget 49
      ShowWidget 37
      ShowWidget 38
      ShowWidget 39
      ShowWidget 40
      ShowWidget 41
      ShowWidget 42
      ShowWidget 43
      ShowWidget 44
      ShowWidget 45
      ShowWidget 46
    End
    If $SELEC == {2} Then
    Begin
      HideWidget 1
      HideWidget 71

      ShowWidget 4
      ShowWidget 50

      If $GnomeY == {1} Then
      Begin
        ShowWidget 51
        ShowWidget 52
        ShowWidget 53
        ShowWidget 54
      End
      Else
        ShowWidget 55

      If $GnomeS == {1} Then
      Begin
        ShowWidget 57
        ShowWidget 58
      End
      Else
      Begin
        If $GnomeY == {1} Then
           ShowWidget 59
      End

      If $KdeY == {1} Then
      Begin
        ShowWidget 60
        ShowWidget 61
        ShowWidget 62
      End
      Else
        ShowWidget 63
    ShowWidget 64

    End
  End
End

############# Cancel
Widget 3
Property
 Size 30 30
 Position 520 320
 Flags NoReliefString
 Type PushButton
 Title {Cancel}
Main
 Case message of
  SingleClic :
  Begin
   Quit
  End
End

############ Restart to apply
 
Widget 80
Property
 Position 20 110
 Flags NoReliefString
 Type ItemDraw
 Title {Your new FVWM configuration file has been built and installed. For further FVWM cusomtization}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 81
Property
 Position 20 130
 Flags NoReliefString
 Type ItemDraw
 Title {you can edit this file, read the FVWM man pages and the FAQ. Also, you will find a special}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 82
Property
 Position 20 150
 Flags NoReliefString
 Type ItemDraw
 Title {MINI-FAQ on this file via the root menu (Documents->Mini-FAQ).}
Main
 Case message of
  SingleClic :
  Begin
  End
End


Widget 2
Property
 Size 70 30
 Position 235 190
 Flags NoReliefString
 Type PushButton
 Title {Restart To Apply}
Main
 Case message of
  SingleClic :
  Begin
   Do Restart
   Quit
  End
End


############ Build the config
 
Widget 71
Property
 Size 570 20
 Position 20 140
 Flags NoReliefString
 Type ItemDraw
 Title {Are you ready to build the configuration?}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 1
Property
 Size 70 30
 Position 265 180
 Flags NoReliefString
 Type PushButton
 Title {Yes, I am!}
Main
 Case message of
  SingleClic :
  Begin

   # Create the fvwm user dir if needed.
   # No, FVWM is responsible to create it. (And this command is not portable)
   #Do {[Exec /bin/mkdir -p } $FDIR

   # Backup: fvwm-script-setup95.pl does that

   Set $ImagePath = (GetTitle 24)
   Set $SoundPath = (GetTitle 29)
   Set $SoundPlayer = (GetTitle 33)
   Set $Editor = (GetTitle 37)
   Set $FileMgr = (GetTitle 40)
   Set $Term = (GetTitle 43)

   # To prevent perl error:
   If $Editor == {} Then
      Set $Editor = {emacs}
   If $FileMgr == {} Then
      Set $FileMgr = {xfm}
   If $Term == {} Then
      Set $Term = {xterm}
   If $SoundPath == {} Then
      Set $SoundPath = {/usr/share/sounds/}
   If $SoundPlayer == {} Then
      Set $SoundPlayer = {rplay}
   If $ImagePath == {} Then
      Set $ImagePath = {No}
   If $ImagePath == {No} Then
      Set $IP={0}
   If $DefImagePath == {} Then
      Set $DefImagePath = {Not Set}

   If $Editor == {xemacs} Then
      Set $Reditor = {emacs}
   If $Editor == {gvim} Then
      Set $Reditor = {VIM}
   If $Editor == {/usr/dt/bin/dtpad} Then
      Set $Reditor = {dtpad}
   If $Reditor == {} Then
      Set $Reditor = $Editor

   Set $GnomeSysMenuGtk = (Mult $GnomeMenuGtk $GnomeSysMenu)
   Set $GnomeUserMenuGtk = (Mult $GnomeMenuGtk $GnomeUserMenu)
   Set $GnomeRHMenuGtk = (Mult $GnomeMenuGtk $GnomeRHMenu)
   Set $GnomeSysMenuFvwm = (Mult $GnomeMenuFvwm $GnomeSysMenu)
   Set $GnomeUserMenuFvwm = (Mult $GnomeMenuFvwm $GnomeUserMenu)
   Set $GnomeRHMenuFvwm = (Mult $GnomeMenuFvwm $GnomeRHMenu)

   If $KdeSysMenu == {1} Then
      Set $KdeMenu = {1}
   If $KdeUserMenu == {1} Then
      Set $KdeMenu = {1}

   Set $PERLCMD = $DATADIR {/fvwm-script-setup95.pl --configin=} $INPUT { --dirout=} $FDIR { --fvwm=} $Fvwm { --sxs=} $Slow { --km=} $KdeMenu { --ksm=} $KdeSysMenu { --kum=} $KdeUserMenu { --kfm=} $KfmIcons { --gmg=} $GnomeMenuGtk { --gsmg=} $GnomeSysMenuGtk { --gumg=} $GnomeUserMenuGtk { --grmg=} $GnomeRHMenuGtk { --gsmf=} $GnomeSysMenuFvwm { --gumf=} $GnomeUserMenuFvwm { --grmf=} $GnomeRHMenuFvwm { --gs=} $GnomeSession { --gy=} $GnomeY { --gpath=} $GnomePath { --cde=} $Cde { --stroke=} $Stroke { --lap=} $Laptop { --pp=} $PanelStaysPut { --editor="} $Editor {" --reditor="} $Reditor {" --file="} $FileMgr {" --term="} $Term {" --spl="} $SoundPlayer {" --spa=} $SoundPath { --i=} $IP { --ip=} $ImagePath { --dip="} $DefImagePath {"}

  Do {BusyCursor Read True}
  Do {Echo Piperead 'perl } $PERLCMD {'}
  Do {Piperead 'perl } $PERLCMD {'}

  # cp the .start-* file if there are no
  Do {PipeRead '[ -f } $FDIR {/.start-Background ] || echo "AddToFunc StartFunction I Exec exec xsetroot -solid orchid4">} $FDIR {/.start-Background'}
  Do {PipeRead '[ -f } $FDIR {/.start-DeskerPanelButtons ] || echo "AddToFunc StartFunction I FvwmButtons DeskerPanelButtons">} $FDIR {/.start-DeskerPanelButtons'}
  If $GnomeSession == {0} Then
  Begin
    If $Fvwm == {1} Then
      Do {PipeRead '[ -f } $FDIR {/.start-apps-man ] || echo "AddToFunc StartFunction I IconManGlobal">} $FDIR {/.start-apps-man'}
    Else
      Do {PipeRead '[ -f } $FDIR {/.start-apps-man ] || echo "AddToFunc StartFunction I TaskBarDesk">} $FDIR {/.start-apps-man'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmButtons ] || echo "AddToFunc StartFunction I FvwmButtons BarButtons">} $FDIR {/.start-FvwmButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmAnimate ] || echo "AddToFunc StartFunction I FvwmAnimate">} $FDIR {/.start-FvwmAnimate'}
  End
  Else
  Begin
    Do {PipeRead '[ -f } $FDIR {/.start-apps-man ] || echo "AddToFunc StartFunction I Style * NoIcon # No applications Manager">} $FDIR {/.start-apps-man'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmButtons ] || echo "# No Buttons Bar">} $FDIR {/.start-FvwmButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmAnimate ] || echo "# Do not start FvwmAnimate">} $FDIR {/.start-FvwmAnimate'}
  End

    Do {PipeRead '[ -f } $FDIR {/.start-MiniButtons ] || echo "# Do not start FvwmButtons MiniButtons">} $FDIR {/.start-MiniButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-WinMakerAppButtons ] || echo "# Do not start FvwmButtons WinMakerAppButtons">} $FDIR {/.start-WinMakerAppButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmAuto ] || echo "# Do not start FvwmAuto">} $FDIR {/.start-FvwmAuto'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmBanner ] || echo "# Do not start FvwmBanner">} $FDIR {/.start-FvwmBanner'}
   Do {PipeRead '[ -f } $FDIR {/.start-FvwmEvent ] || echo "# Do not start FvwmEvent">} $FDIR {/.start-FvwmEvent'}
   Do {PipeRead '[ -f } $FDIR {/.fvwm-layers ] || echo "Style MiniButtons StaysOnTop">} $FDIR {/.fvwm-layers'}

  Do {BusyCursor Read False}
  ShowWidget 2
  ShowWidget 80
  ShowWidget 81
  ShowWidget 82

  HideWidget 71
  HideWidget 1
  HideWidget 5
  End
End

##########################################################################
# If Perl is not installed !!

Widget 90
Property
 Position 20 110
 Flags NoReliefString
 Type ItemDraw
 Title {It seems that perl is not installed in your machine (bad idea). So, this script will just copy}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 91
Property
 Position 20 130
 Flags NoReliefString
 Type ItemDraw
 Title {fvwm2rc.system-sample-95 to your FVWM configuration directory.}
Main
 Case message of
  SingleClic :
  Begin
  End
End


Widget 92
Property
 Size 70 30
 Position 265 160
 Flags NoReliefString
 Type PushButton
 Title {Copy!}
Main
 Case message of
  SingleClic :
  Begin

   # Create the fvwm user home dir if need
   If $FDIR <> {} Then
      Do {PipeRead '/bin/mkdir -p } $FDIR
 
   # Backup
   Set $DATE = {date +%Y%m%d-%H%M%S}
   Set $Backup = (GetOutput  $DATE 1 -1)
   Set $Backup = $OUTPUT {-} $Backup
   Do {PipeRead 'if [ -f } $OUTPUT { ]; then  /bin/mv } $OUTPUT { } $Backup{; fi; sed -e /^#\\!D.*/d -e s/[:space:]*#\\!E.*// } $INPUT { > } $OUTPUT{'}
     # cp the .start-* file if there are no
  Do {PipeRead '[ -f } $FDIR {/.start-Background ] || echo "AddToFunc StartFunction I Exec exec xsetroot -solid orchid4">} $FDIR {/.start-Background'}
  Do {PipeRead '[ -f } $FDIR {/.start-DeskerPanelButtons ] || echo "AddToFunc StartFunction I FvwmButtons DeskerPanelButtons">} $FDIR {/.start-DeskerPanelButtons'}
  If $GnomeSession == {0} Then
  Begin
    If $Fvwm == {1} Then
      Do {PipeRead '[ -f } $FDIR {/.start-apps-man ] || echo "AddToFunc StartFunction I IconManGlobal">} $FDIR {/.start-apps-man'}
    Else
      Do {PipeRead '[ -f } $FDIR {/.start-apps-man ] || echo "AddToFunc StartFunction I TaskBarDesk">} $FDIR {/.start-apps-man'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmButtons ] || echo "AddToFunc StartFunction I FvwmButtons BarButtons">} $FDIR {/.start-FvwmButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmAnimate ] || echo "AddToFunc StartFunction I FvwmAnimate">} $FDIR {/.start-FvwmAnimate'}
  End
  Else
  Begin
    Do {PipeRead '[ -f } $FDIR {/.start-apps-man ] || echo "AddToFunc StartFunction I Style * NoIcon # No applications Manager">} $FDIR {/.start-apps-man'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmButtons ] || echo "# No Buttons Bar">} $FDIR {/.start-FvwmButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmAnimate ] || echo "# Do not start FvwmAnimate">} $FDIR {/.start-FvwmAnimate'}
  End

    Do {PipeRead '[ -f } $FDIR {/.start-MiniButtons ] || echo "# Do not start FvwmButtons MiniButtons">} $FDIR {/.start-MiniButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-WinMakerAppButtons ] || echo "# Do not start FvwmButtons WinMakerAppButtons">} $FDIR {/.start-WinMakerAppButtons'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmAuto ] || echo "# Do not start FvwmAuto">} $FDIR {/.start-FvwmAuto'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmBanner ] || echo "# Do not start FvwmBanner">} $FDIR {/.start-FvwmBanner'}
    Do {PipeRead '[ -f } $FDIR {/.start-FvwmEvent ] || echo "# Do not start FvwmEvent">} $FDIR {/.start-FvwmEvent'}
   Do {PipeRead '[ -f } $FDIR {/.fvwm-layers ] || echo "Style MiniButtons StaysOnTop">} $FDIR {/.fvwm-layers'}

  ShowWidget 2
  ShowWidget 80
  ShowWidget 81
  ShowWidget 82

  HideWidget 90
  HideWidget 91
  HideWidget 92
  HideWidget 1
  HideWidget 5
  End
End
