1 # Copied from Lyx-Mac-binary-release.sh
2 # TODO: In order to avoid having two versions,
3 # call this file from Lyx-Mac-binary-release.sh
11 # Creates the structure
13 touch "${FILE}/${LyxName}.app"
14 touch "${FILE}/Applications"
16 # Copy the background and make sure the file is visible
17 # For some reason (OS X cache?), we need to remove the previous
19 rm -f "$FILE/background.png"
20 cp "$IMAGEPATH" "$FILE/background.png"
21 xattr -c "$FILE/background.png"
23 Y_POSITION=$((Y_BOUNDS - 65))
24 Y_BOUNDS=$((Y_BOUNDS + 20))
25 LYX_X_POSITION=$((X_BOUNDS / 4))
26 LYX_Y_POSITION=$Y_POSITION
27 APP_X_POSITION=$((3 * X_BOUNDS / 4))
28 APP_Y_POSITION=$Y_POSITION
29 WITH_DOCUMENTS=$(test -d "${FILE}/Documents" && echo true || echo false)
31 tell application "Finder"
32 set f to POSIX file ("$FILE" as string) as alias
33 set image to POSIX file ("$IMAGEPATH" as string) as alias
37 set toolbar visible to false
38 set statusbar visible to false
39 set current view to icon view
41 set the bounds to {20, 50, $X_BOUNDS, $Y_BOUNDS}
44 set icon size of the icon view options of container window to 64
45 set arrangement of the icon view options of container window to not arranged
46 if ${WITH_DOCUMENTS} then
47 set position of item "Documents" to {$LYX_X_POSITION,0}
49 set position of item "${LyxName}.app" to {$LYX_X_POSITION,$LYX_Y_POSITION}
50 set position of item "Applications" to {$APP_X_POSITION,$APP_Y_POSITION}
51 set background picture of the icon view options of container window to file "background.png"
52 set the bounds of the container window to {0, 0, $X_BOUNDS, $Y_BOUNDS}
53 update without registering applications
61 # Hide again the background
62 chflags hidden "$FILE/background.png"