WindowTitle {ConfirmCopyConfig}
WindowSize  500 160
Font "xft:Sans:size=10"
Init
 Begin
  Set $DataDir=(GetOutput {echo "$FVWM_DATADIR"} 1 -1)
  Set $UserDir=(GetOutput {echo "$FVWM_USERDIR"} 1 -1)
  Set $DefaultConf=$DataDir {/default-config/config}
  Set $UserConf=$UserDir {/config}
  Set $BackupConf=$UserDir {/config-bak}
  
  ChangeTitle 3 $UserConf
  ChangeTitle 5 $BackupConf

  Do {Style ConfirmCopyConfig Layer 6}
 End

Widget 1
Property
 Title {Fvwm Default Configuration}
 Font "xft:Sans:size=14"
 Size  500 25
 Position 0 0
 Type ItemDraw
 Flags NoReliefString Center
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 2
Property
 Title {This script copies the default configuration into your home directory:}
 Size  400 12
 Position 15 30
 Type ItemDraw
 Flags NoReliefString Left
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 3
Property
 Title {}
 Size  400 17
 Position 70 50
 Type ItemDraw
 Flags NoReliefString Left
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 4
Property
 Title {A backup of your current configuration will be located at:}
 Size  400 12
 Position 15 70
 Type ItemDraw
 Flags NoReliefString Left
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 5
Property
 Title {}
 Size  400 17
 Position 70 90
 Type ItemDraw
 Flags NoReliefString Left
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 6
Property
 Title {Click Confirm to continue and restart Fvwm.}
 Size  400 15
 Position 15 107
 Type ItemDraw
 Flags NoReliefString Left
Main
 Case message of
  SingleClic :
  Begin
  End
End


Widget 7
Property
 Title {Confirm}
 Colorset 13
 Size 60 28
 Position 100 130
 Flags NoReliefString 
 Type PushButton
 Value 1
Main
 Case message of
  SingleClic :
  Begin
   Do {Test (f } $UserConf {) PipeRead `mv "} $UserConf {" "} $BackupConf {"; echo "Echo Backup: } $BackupConf {"`}
   Do {PipeRead `cp "} $DefaultConf {" "} $UserDir {"; echo "Echo Copied default config to } $UserDir {"`}
   Do {Restart}
   Quit
  End
End

Widget 8
Property
 Title {Cancel}
 Colorset 13
 Size 60 28
 Position 350 130
 Flags NoReliefString
 Type PushButton
 Value 1
Main
 Case message of
  SingleClic :
  Begin
   Quit
  End
End
