Skip to content

Commit

Permalink
Update App
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1111 committed Jan 7, 2024
1 parent 6745eca commit 85dcd39
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 104 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenCanopy Generator

![AppIcon](https://user-images.githubusercontent.com/6248794/108217341-795d5d80-7101-11eb-9c78-47827592b801.png)
<img width="250" alt="AppIcon" src="https://github.com/chris1111/OpenCanopy-Generator/assets/6248794/8f8be0c6-99f5-4abd-b6c5-d0c86a073add">

- Build by [chris1111](https://github.com/chris1111/)
- Credit: [pngquant](https://pngquant.org), [Acidanthera](https://github.com/acidanthera/OpenCorePkg), [blackosx](https://www.insanelymac.com/forum/profile/331032-blackosx/), [pkdesign](https://www.insanelymac.com/forum/profile/488070-pkdesign/)
Expand Down Expand Up @@ -66,13 +66,13 @@ This tool is for create OpenCore Themes. create a set of Icon at the good size.
#### Looking for ➣ [Themes exemple](https://github.com/chris1111/My-Simple-OC-Themes/blob/master/Download.md)

### Release Update
- Release V5 uppdate 07 May 2023 Update app
- Release V6 uppdate 06 Jan 2024 Update app

View full Video ⬇︎
### Video release V-1
[![Modular Image Creation](https://i.ibb.co/K5bFrB5/VIDEO.png)](https://youtu.be/3zK7SGYhZ8Q)

### Download V-5[OpenCanopy Generator](https://github.com/chris1111/OpenCanopy-Generator/releases/tag/V5)
### Download V-6[OpenCanopy Generator](https://github.com/chris1111/OpenCanopy-Generator/releases/tag/V6)

### Setup config.plist ⇩

Expand Down
Binary file modified Source/AppIcon.icns
Binary file not shown.
Binary file added Source/AppIconOff.icns
Binary file not shown.
148 changes: 69 additions & 79 deletions Source/Builder
Original file line number Diff line number Diff line change
@@ -1,80 +1,70 @@
#!/bin/bash
# OpenCanopy Generator
# Copyright (c) 2021, chris1111. All Right Reserved
# Simple bash script for icnspack by chris1111
# Credit: Acidanthera, blackosx, pkdesign, pngquant.
# Vars
apptitle="OpenCanopy Generator"
version="1.0"
PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"
IN_DIR="/Private/tmp/Icon"
OUT_DIR="/Private/tmp/Resource"

[[ ! -d "$IN_DIR" ]] && mkdir -p "$IN_DIR"
[[ ! -d "$OUT_DIR" ]] && mkdir -p "$OUT_DIR"

for pngFile in "$IN_DIR"/*.png
do

filename=$(basename -- "$pngFile")
filenameNoExt="${filename%*.png}"

cp "$pngFile" "$OUT_DIR"

width=$(sips -g pixelWidth "$pngFile")
height=$(sips -g pixelHeight "$pngFile")

width="${width##*: }"
height="${height##*: }"

halfWidth=$(( width/2 ))
halfHeight=$(( height/2 ))

sips --deleteProperty profile -Z $halfWidth $halfHeight "$pngFile" --out "$OUT_DIR"/"$filenameNoExt"_sml.png &>/dev/null

./pngquant --quality=90 --ext=.png --force "$OUT_DIR"/*.png

./icnspack "$OUT_DIR"/"$filenameNoExt".icns "$OUT_DIR"/"$filenameNoExt"_sml.png "$OUT_DIR"/"$filenameNoExt".png && echo "Generated $filenameNoExt.icns" && rm "$OUT_DIR"/*.png

done
Sleep 1
cd /Private/tmp
zip -r Resource.zip Resource
Sleep 1
osascript <<EOD
display dialog "
Please select a destination to save the file Resource.zip
NOTE: If you have already a Resource.zip in this location, you must move it or rename to save another one otherwise it will be replaced." with icon POSIX file "/Private/tmp/Appicon.icns" buttons {"Save"} default button {"Save"}
{"Save"}
EOD

# Get image file location
#!/bin/bash
# OpenCanopy Generator
# Copyright (c) 2021, 2024 chris1111. All Right Reserved
# Simple bash script for icnspack by chris1111
# Credit: Acidanthera, blackosx, pkdesign, pngquant.
# Vars
apptitle="OpenCanopy Generator"
version="1.0"
PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"
IN_DIR="/Private/tmp/Icon"
OUT_DIR="/Private/tmp/Resource"

[[ ! -d "$IN_DIR" ]] && mkdir -p "$IN_DIR"
[[ ! -d "$OUT_DIR" ]] && mkdir -p "$OUT_DIR"


for pngFile in "$IN_DIR"/*.png
do

filename=$(basename -- "$pngFile")
filenameNoExt="${filename%*.png}"

cp "$pngFile" "$OUT_DIR"

width=$(sips -g pixelWidth "$pngFile")
height=$(sips -g pixelHeight "$pngFile")

width="${width##*: }"
height="${height##*: }"

halfWidth=$(( width/2 ))
halfHeight=$(( height/2 ))

sips --deleteProperty profile -Z $halfWidth $halfHeight "$pngFile" --out "$OUT_DIR"/"$filenameNoExt"_sml.png &>/dev/null

./pngquant --quality=90 --ext=.png --force "$OUT_DIR"/*.png

./icnspack "$OUT_DIR"/"$filenameNoExt".icns "$OUT_DIR"/"$filenameNoExt"_sml.png "$OUT_DIR"/"$filenameNoExt".png && echo "Generated $filenameNoExt.icns" && rm "$OUT_DIR"/*.png

done
Sleep 1
cd /Private/tmp
zip -r Resource.zip Resource
Sleep 1
osascript <<EOD
display dialog "
Please select a destination to save the file Resource.zip
NOTE: If you have already a Resource.zip in this location, you must move it or rename to save another one otherwise it will be replaced." with icon note buttons {"Save"} default button {"Save"} {"Save"}
EOD

# Get image file location
imagepath=`/usr/bin/osascript << EOT
tell application "Finder"
activate
set sourceFolder to (POSIX file "/Private/tmp/Resource.zip") as alias
set imagepath to choose folder with prompt "Choose the destination location" default location (path to desktop)
duplicate sourceFolder to folder imagepath with replacing
end tell
delay 1
set myFile to "/Private/tmp/Resource.zip"
set myFolder to "/Private/tmp/Resource"
set myIconFolder to "/Private/tmp/Icon"
set myIcon to "/Private/tmp/AppIcon.icns"
try
do shell script "rm -rf " & quoted form of myFile
do shell script "rm -rf " & quoted form of myFolder
do shell script "rm -rf " & quoted form of myIconFolder
do shell script "rm -rf " & quoted form of myIcon
end try
return
EOT`
echo "
******************************************************
Files is generates!
******************************************************"
osascript -e 'do shell script "afplay './Funk.aiff' &> /dev/null &"'
osascript -e 'display notification "OpenCanopy Generator" with title "'"$apptitle"'" subtitle "All is Done"'
tell application "Finder"
activate set sourceFolder to (POSIX file "/Private/tmp/Resource.zip") as alias set imagepath to choose folder with prompt "Choose the destination location" default location (path to desktop) duplicate sourceFolder to folder imagepath with replacingend tell
delay 1set myFile to "/Private/tmp/Resource.zip"
set myFolder to "/Private/tmp/Resource"
set myIconFolder to "/Private/tmp/Icon"try do shell script "rm -rf " & quoted form of myFile
do shell script "rm -rf " & quoted form of myFolder
do shell script "rm -rf " & quoted form of myIconFolderend try
return
EOT`
echo "
******************************************************
Files is generates!
******************************************************"
osascript -e 'do shell script "afplay './Funk.aiff' &> /dev/null &"'
osascript -e 'display notification "OpenCanopy Generator" with title "'"$apptitle"'" subtitle "All is Done"'
Expand Down
Binary file added Source/MainMenu.nib/keyedobjects.nib
Binary file not shown.
48 changes: 26 additions & 22 deletions Source/script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# OpenCanopy Generator
# Copyright (c) 2021, chris1111. All Right Reserved
# Copyright (c) 2021, 2024 chris1111. All Right Reserved
# Simple bash script for icnspack by chris1111
# Credit: Acidanthera, blackosx, pkdesign, pngquant.
# Permission to use, copy, modify, and/or distribute this software for any
Expand All @@ -17,9 +17,9 @@
# Vars
apptitle="OpenCanopy Generator"
version="1.0"
cp -rp ./AppIcon.icns /Private/tmp/AppIcon.icns
# Set Icon directory and file
iconfile="/Private/tmp/AppIcon.icns"
export ICNS=$(dirname "${0}")
iconfile="$ICNS/AppIcon.icns"
TempDir="/Private/tmp/Icon"
SourceDir="/Private/tmp/Resource"
osascript -e "set Volume 3"
Expand All @@ -38,48 +38,39 @@ fi

echo "
Welcome OpenCanopy Generator
Make sure you follow the instructions correctly
⬇︎
Make sure you follow the instructions correctly ⬇︎
This is a GUI tool for creating OpenCanopy icons for use with OpenCore.
Create a set of PNG icons at the correct size and resolution
(see below) They can be named anything during creation but must be renamed to follow OpenCore/OpenCanopy requirements.
-----------------------------
- Selector.png, Selected.png, Apple.png, ExtHardDrive.png, AppleRecv.png, ExtAppleRecv.png, ExtAppleTM.png, HardDrive.png, AppleTM.png, Windows.png, Tool.png, Shell.png, Left.png, Right.png, Cursor.png, Restart.png, ShutDown.png, Background.png, BtnFocus.png, Dot.png, Enter.png, SetDefault.png, Lock.png
### Create Flavours Theme ➥ See (https://github.com/chris1111/OpenCanopy-Generator/blob/OpenCanopy-Generator.dmg/Flavours.md)
-----------------------------
#### TAKE NOTE: for OC 0.6.6 and Higher
* Background.png must be 3840x2160 in 144 pixels this is for 1080p
* Left.png and Right.png must be 80x80 in 144 pixels
* Selector.png must be 80x80 in 144 pixels
* Selected.png must be 288x288 in 144 pixels
* BtnFocus.png must be 100x100 in 144 pixels
* Dot.png must be 14x14 in 144 pixels
* Enter.png must be 115x50 in 144 pixels
* SetDefault.png must be 80x80 in 144 pixels
* Lock.png must be 160x222 in 144 pixels
* All the others must be 256x256 in 144 pixels
******************************************************
Drag your PNG images to process them "

# Set Droping directory and file
for files in "$@" ;do

osascript <<EOD
tell application "OpenCanopy Generator"
activate
end tell
EOD


# Select Proceed
response=$(osascript -e 'tell app "System Events" to display dialog "OpenCanopy Generator
Expand All @@ -88,6 +79,14 @@ Cancel for Exit" buttons {"Cancel","Proceed"} default button 2 with title "'"$ap

action=$(echo $response | cut -d ':' -f2)

osascript <<EOD
tell application "OpenCanopy Generator"
activate
end tell
EOD



# Exit if Canceled
if [ "$action" == "Cancel" ] ; then
osascript -e 'do shell script "afplay './Sound/Funk.aiff' &> /dev/null &"'
Expand All @@ -98,7 +97,6 @@ if [ "$action" == "Cancel" ] ; then
exit 0
fi


echo "Image processing :"
osascript -e 'do shell script "afplay './Sound/Hero.aiff' &> /dev/null &"'
Sleep 1
Expand All @@ -109,6 +107,12 @@ cp -R "$@" "${TempDir}"
sleep 1
./Builder "${TempDir}"

osascript <<EOD
tell application "OpenCanopy Generator"
activate
end tell
EOD

# Exit App
EXIT=Resource.zip
echo Save ➣ $EXIT
Expand Down

0 comments on commit 85dcd39

Please sign in to comment.