Created
March 19, 2021 15:05
-
-
Save theapache64/18b9c281224f19abf506cfd82dff6253 to your computer and use it in GitHub Desktop.
To generate launcher icons for compose desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gen-cfd-icon(){ | |
ICON_DIR="src/main/resources/drawables/launcher_icons" | |
mkdir -p $ICON_DIR | |
ORIGINAL_ICON="$ICON_DIR/original.png" | |
cp "$1" "$ORIGINAL_ICON" | |
# Linux | |
echo "🌀 Creating icon for Linux..." | |
convert -resize x128 "$ORIGINAL_ICON" "$ICON_DIR/linux.png" | |
# Windows | |
echo "🌀 Creating icon for Windows..." | |
convert -resize x128 "$ORIGINAL_ICON" "$ICON_DIR/windows.ico" | |
# MacOS | |
echo "🌀 Creating icon for macOS..." | |
convert -resize x128 "$ORIGINAL_ICON" "$ICON_DIR/macos.icns" | |
## Printing code | |
echo "Add this to your build.gradle.kts ⬇️" | |
OUTPUT=" | |
val iconsRoot = project.file(\"src/main/resources/drawables\") | |
linux { | |
iconFile.set(iconsRoot.resolve(\"launcher_icons/linux.png\")) | |
} | |
windows { | |
iconFile.set(iconsRoot.resolve(\"launcher_icons/windows.ico\")) | |
} | |
macOS { | |
iconFile.set(iconsRoot.resolve(\"launcher_icons/macos.icns\")) | |
}" | |
echo "$OUTPUT" | |
echo "$OUTPUT" | xclip | |
echo "Copied to your clipboard" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment